【问题标题】:I'm having npm start problems, can someone help me?我遇到了 npm start 问题,有人可以帮助我吗?
【发布时间】:2016-02-07 16:12:01
【问题描述】:

我最近遇到了这个问题,并使用了 npm install 之类的命令,然后重新启动但没有运气,有人可以帮助我吗?当我点击 ctrl -c 然后点击 npm start 重新加载服务器时,这开始了,然后我被所有这些错误击中。我试图寻找答案,但没有运气。

    Alexs-MacBook-Air:1app alexjurado$ npm start

> 1app@0.0.0 start /Users/alexjurado/1app
> node ./bin/www

module.js:328
    throw err;
    ^

Error: Cannot find module 'mongodb'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/alexjurado/1app/app.js:7:13)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm  v3.7.1
npm ERR! code ELIFECYCLE
npm ERR! 1app@0.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the 1app@0.0.0 start script 'node ./bin/www'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the 1app 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 information on how to open an issue for this project with:
npm ERR!     npm bugs 1app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 1app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/alexjurado/1app/npm-debug.log

【问题讨论】:

标签: node.js mongodb npm


【解决方案1】:

你的 package.json 中有 mongodb 依赖吗? npm install 将安装你放在依赖项中的模块

"dependencies": 
  {
    "express":      "~4.13.4",
    "mongodb":      "~2.1.5"

    .......
  }

更新你的 package.json 并运行 npm install

【讨论】:

  • 运行 'npm install' 后,你看到你的 package.json 文件所在的文件夹 'node_modules\mongodb' 了吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-20
  • 2021-05-09
  • 2020-09-29
  • 1970-01-01
  • 2021-04-19
  • 1970-01-01
相关资源
最近更新 更多