当我做npm开始时出现此错误

时间:2015-01-05 10:37:30

标签: node.js npm spawn

我对这个node.js全新!如何克服以下错误。尝试了网上给出的所有可能的解决方案。并且在环境变量发生变化后发生了此错误。请帮我解决问题。提前致谢。

C:\project\nodetest1>npm start

> nodetest1@0.0.0 start C:\project\nodetest1
> node ./bin/www


npm ERR! nodetest1@0.0.0 start: `node ./bin/www`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the nodetest1@0.0.0 start script.
npm ERR! This is most likely a problem with the nodetest1 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 nodetest1
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! cwd C:\project\nodetest1
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! syscall spawn
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! nodetest1@0.0.0 start: `node ./bin/www`
npm ERR! Exit status -1
npm ERR!
npm ERR! Failed at the nodetest1@0.0.0 start script.
npm ERR! This is most likely a problem with the nodetest1 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 nodetest1
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! cwd C:\project\nodetest1
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\project\nodetest1\npm-debug.log
npm ERR! not ok code 0

package.json是

 {
  "name": "nodetest1",
  "version": "0.0.0",
  "private": true,
  "scripts": {
  "start": "node ./bin/www"
 },
  "dependencies": {
  "body-parser": "~1.8.1",
  "cookie-parser": "~1.3.3",
  "debug": "~2.0.0",
  "express": "~4.9.0",
  "express-session": "^1.9.3",
  "jade": "~1.6.0",
  "mongodb": "*",
  "mongoose": "^3.8.21",
  "monk": "*",
  "morgan": "~1.3.0",
  "nodemon": "*",
  "passport": "*",
  "passport-local": "*",
  "serve-favicon": "~2.1.3"
 }

}

1 个答案:

答案 0 :(得分:0)

此错误也发生在我身上。这是因为环境中的路径变量。因此只需更改unistall node.js并从系统中删除路径变量,并从AppData \ Roaming \ npm中删除Npm和npm-cache。然后安装节点它肯定会起作用