I am getting the below error:
{ [Error: Cannot find module \'../build/Release/bson\'] code: \'MODULE_NOT_FOUND\' }
js-bson: Failed to load c++ bson extens
I also had the same problem with bson.
trying a newer mongoose version
npm install mongoose@4.4
solved the issue.
Massimo.
The best solution for me was to upgrade from node-mongodb 1.x to 2.x.
I had the same issue after upgrade version of ubuntu to 16.04. I solved in this way, hope it helps.
$rm -rf node_modules
$npm --save install bson
$npm --save install mongoose
$npm install
The only thing which helps me on Windows 7 (x64): https://stackoverflow.com/a/29714359/2670121
Reinstall node and python with x32 versions.
I spent many time with this error (Failed to load c++ bson extension) and finally, when I installed module node-gyp
(for build native addons) and even installed windows SDK with visual studio - nodejs didn't recognize assembled module bson.node as module. After reinstall the problem is gone.
Again, What means this error?
Actually, it's even not error. You still can use mongoose. But in this case, instead of fast native realization of bson module, you got js-realization, which slower. I saw many tips like: "edit path deep inside node_modules..." - which totaly useless because it's not solve the problem but just turned off the error messages.
Run this command to uninstall mongoose npm uninstall --save mongoose
- thereafter reinstall it but this time npm
automatically installs the latest version of mongoose run npm install --save mongoose
This worked for me.
I resolved this issue by installing mogoose version 3.8.23
npm install mongoose@3.8.23