Error: cannot find module ‘mongoose’

When you enter the command NPM start to start the project, sometimes you will encounter such Error Error: Cannot find module ‘mongoose’, missing the module mongoose.

Error: Cannot find module 'mongoose'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (D:\loginproject\routes\index.js:3:16)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Program Files\nodejs\node_cache\_logs\2019-01-09T01_53_44_235Z-debug.log

The solution at this point is to install the missing module:

npm install mongoose

Run successfully, open the browser to enter the access address, you can see the project.

Girl when she was the original author: qi technology blog: https://www.jianshu.com/u/05f416aefbe1
90 front after sister, love programming, love, love.
stick to summarize the technical problems encountered in the work, keep a record of what you think and see in the work, for the blog above there are no questions, you can join the qq group to ask me: 473819131.

Read More: