昨天从官网上下载了4.2.1的安装包,安装完成后: node -v 正常 ,但npm -v就出问题了。
C:\Users\pc>node -v v4.2.1 C:\Users\pc>npm -v ’CALL “%F” “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_mo dules\npm\bin\npm-cli.js” prefix -g’ 不是内部或外部命令,也不是可运行的程序 或批处理文件。 2.14.7
虽然能使用,install 指令也能执行,但start指令就报错了!
npm ERR! Windows_NT 6.1.7601
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js” "start"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! file C:\windows\system32\cmd.exe;
npm ERR! path C:\windows\system32\cmd.exe;
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\windows\system32\cmd.exe;
npm ERR! app@0.0.0 start: node ./bin/www
npm ERR! spawn C:\windows\system32\cmd.exe; ENOENT
npm ERR!
npm ERR! Failed at the app@0.0.0 start script ‘node ./bin/www’.
npm ERR! This is most likely a problem with the app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get their info via:
npm ERR! npm owner ls app
npm ERR! There is likely additional logging output above.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js” "start"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! app@0.0.0 start: node ./bin/www
npm ERR! Exit status -4058
npm ERR!
npm ERR! Failed at the app@0.0.0 start script ‘node ./bin/www’.
npm ERR! This is most likely a problem with the app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get their info via:
npm ERR! npm owner ls app
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! F:\node\app\npm-debug.log
有人可以告诉我怎么解决这个问题吗?
不用npm start ,直接用 node ./bin/www 会出问题吗?
@zhou-yg 不会,它能跑3000端口
npm start 或者 node app.js 如果还不行的话 就来玩pm2