Find in npm module mongodb:
..\node_modules\mongodb\node_modules\bson\ext\index.js
Change path to js version in catch block:
bson = require('../build/Release/bson');
To:
bson = require('../browser_build/bson');
Or copy file in:
..\node_modules\bson\build\Release\bson
From:
..\node_modules\bson\browser_build\bson
I had this issue today (Feb 19th, 2016) and I solved it just by installing the latest version of Mongoose. Try putting this in your package.json:
"mongoose": "~4.4"
Hope that helps. Solved it for me!
The problem is when you install mongoose via npm it assumes you have python installed on your windows and tries to build required libraries. Since you do not have python it skips building phase with a warning. But when you start your application, required modules are not there so you get this error.
In order to do things right first install python (version 2.7) on your computer from: https://www.python.org/downloads/ or if u have installed chockolatey just type choco install python2
.
Then make sure your python variable is set. You can set it on command prompt like:
SET python=D:\Python27\python.exe
(Of course you should change the path according to your location of python) Then install node-gyp:
npm install -g node-gyp
Now you can reinstall mongoose or whatever module causing the problem:
npm install mongoose
You will see some yellow lines instead of red ones this time but the error will be gone.
I resolved this issue by installing mogoose version 3.8.23
npm install [email protected]
This worked for me. Search in your workspace for the text:
"../build/Release/bson"
You will probably find it inside the mongose and monk modules.
Then replace each:
bson = require('../build/Release/bson');
with:
bson = require('bson');
that's all!
Try npm install [email protected]
and also replace
bson = require('../build/Release/bson');
to
bson = require('../browser_build/bson');
in node_modules/bson/ext/index.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With