I am going through my first node.js project. I\'ve installed mongodb, have a server.js file, and when I try to run it I get this error
module.js:340
thro
Install mongodb globally with below steps :-
a) npm install mongodb -g
b) Go to your app directory, where module.js is located and then run
npm link mongodb
Explanation :- When you install a package globally via npm, it is downloaded to global node_module folder. For me(Mac user), it's under /usr/local/lib/node_modules/mongodb. We link this to that directory from where you are trying to run module.js.