npm 开始在 node.js 中给出错误

2024-01-04

我对 Node.js 和 mongodb 完全陌生。我正在使用以下链接:http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/ http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/这个过程运行得非常好并且得到了完全相同的结果。但突然间“npm start”停止工作了。 我卸载了所有东西并尝试从本教程中给出的步骤 1 重新安装。当我发出命令“npm install -g express”时,我没有得到任何 http 304 和 GETS 的列表! 。 当我忽略并继续该过程时,我发出命令 npm start ,但它不起作用。显示的错误如下所示 C:\project\nodetest1>npm 启动

  > [email protected] /cdn-cgi/l/email-protection start C:\project\nodetest1
  > node ./bin/www


   npm ERR! [email protected] /cdn-cgi/l/email-protection start: `node ./bin/www`
   npm ERR! spawn ENOENT
   npm ERR!
   npm ERR! Failed at the [email protected] /cdn-cgi/l/email-protection 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\\nodejs\\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! [email protected] /cdn-cgi/l/email-protection start: `node ./bin/www`
  npm ERR! Exit status -1
  npm ERR!
  npm ERR! Failed at the [email protected] /cdn-cgi/l/email-protection 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:\\ProgramFiles\\nodejs\\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

请帮忙 。提前致谢。


该错误表明未找到./bin/www 目录。用点指定的路径是相对于当前目录的,因此当前目录必须是 C:/project/nodetest1npm start在这种情况下工作。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

npm 开始在 node.js 中给出错误 的相关文章

随机推荐