Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js error Error: Cannot find module 'mongoose'

C:\Users\Nick\Desktop\turntablefm\Bots\Super Bot>node bot.js  node.js:201         throw e; // process.nextTick error, or 'error' event on first tick               ^ Error: Cannot find module 'mongoose'     at Function._resolveFilename (module.js:334:11)     at Function._load (module.js:279:25)     at Module.require (module.js:357:17)     at require (module.js:368:17)     at Object.<anonymous> (C:\Users\Nick\Desktop\turntablefm\Bots\Super Bot\db.j s:1:78)     at Module._compile (module.js:432:26)     at Object..js (module.js:450:10)     at Module.load (module.js:351:31)     at Function._load (module.js:310:12)     at Module.require (module.js:357:17) 

I already installed it using npm install and I tried reinstalling but that didn't work any ideas?

like image 836
Nick Goad Avatar asked Dec 24 '11 06:12

Nick Goad


People also ask

What is Mongoose module in node JS?

Mongoose is a MongoDB ODM (Object database Modelling) that is used to translate the code and its representation from MongoDB to the Node. js server. Advantages of Mongoose module: Collection validation of the MongoDB database can be done easily.

How do I know if mongoose is installed?

If you want to confirm that you have installed mongoose you can check in the node_modules folder. This is the folder where npm installs everything. There is typically a folder for every package installed. You will find a mongoose directory if you have installed mongoose correctly.


1 Answers

try installing mongoose using this command:

npm install mongoose 

do not use the -g switch.

BTW: I ran command prompt in admin mode. Reference

like image 74
Prashant Jain Avatar answered Oct 09 '22 04:10

Prashant Jain