简体   繁体   中英

I'm having npm start problems, can someone help me?

I recently ran into this problem today and used commands like npm install, and restarted and yet no luck, can someone help me? This started when I hit ctrl -c and then hit npm start to reload the server, then I got hit by all these errors. I tried looking for answers but yet no luck.

    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

Do you have mongodb dependency in your package.json? npm install will install the modules you put in dependencies

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

    .......
  }

Update your package.json and run npm install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM