'node'不被识别为内部或外部命令、可操作程序或批处理文件;仅在尝试启动应用程序时



因此,如果我想npm安装一个包或检查节点或npm版本,它可以工作,但如果我尝试用任何脚本启动应用程序,它会显示这一点。[编辑]

$ npm start
> nibblin@0.0.0 start C:UserstrevcDesktopProjectsnibblin
> concurrently "npm run server" "npm run client"
'node' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nibblin@0.0.0 start: `concurrently "npm run server" "npm run 
client"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nibblin@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional 
logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:UserstrevcAppDataRoamingnpm-cache_logs2018-08- 
05T14_06_10_006Z-debug.log

这是我的包裹

{
"name": "nibblin",
"version": "0.0.0",
"private": true,
"scripts": {
"server": "node ./bin/www",
"client": "npm start --prefix client",
"start": "concurrently "npm run server" "npm run client""
},
"dependencies": {
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "~4.16.0",
"http-errors": "~1.6.2",
"jade": "~1.11.0",
"morgan": "~1.9.0",
"concurrently": "^3.6.1"
}
}

在删除所有节点模块并尝试重新安装后,我面临着这个

$ npm i
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading 
Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading 
Browserslist >3.0 config used in other tools.
npm WARN deprecated istanbul-lib-hook@1.2.1: 1.2.0 should have been a major 
version bump
> uglifyjs-webpack-plugin@0.4.6 postinstall 
C:UserstrevcDesktopProjectsnibblinclientnode_modulesuglifyjs-webpack- 
plugin
> node lib/post_install.js
'node' is not recognized as an internal or external command,
operable program or batch file.
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is 
installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 
(node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: 
{"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uglifyjs-webpack-plugin@0.4.6 postinstall: `node 
lib/post_install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the uglifyjs-webpack-plugin@0.4.6 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional 
logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:UserstrevcAppDataRoamingnpm-cache_logs2018-08- 
05T14_50_21_506Z-debug.log

这只发生在我的客户端文件夹创建反应应用

您正在运行的npm脚本是node server.js,但在您的package.json中,您将启动脚本定义为node ./bin/www

在react_redux_express_starter锅炉播放器中,没有bin或www文件夹。所以我想,要么是从另一个样板文件中复制了一个package.json,要么是文件结构搞砸了,要么是在错误的目录中运行了命令。

最新更新