1.直接使用nodejs会遇到以下问题:
module.js:340
throw err;
^Error: Cannot find module 'mongodb'
throw err;
^Error: Cannot find module 'mongodb'
解决方式如下:
After trying for some time to install it without success (since I'm new to mongo and node), I was missing the npm link step indeed. So just to summarize, I did this:
npm install mongodb -g
cd /path/to/my/app/folder
npm link mongodb
2.