0 votes
1 view
in SQL by (30.9k points)

I am getting the below error:

{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version

Here are my version details:

  • OS: Windows 7

  • MongoDB: 2.6.5

  • Node: 0.12.0

I have tried these things before I posted the issue here.

  1. I went to \node-modules\mongoose\node-modules\mongodb\node-modules\bson folder and made below change in the binding-gyp file from 'include_dirs': [ '<!(node -e "require(\'nan\')")' ] to 'include_dirs': ["<!(nodejs -p -e \"require('path').dirname(require.resolve('nan'))\")"]

  2. Ran this command npm install -g node-gyp

  3. I've updated the mongoose version to 3.8.21 inside package.json

Nothing works. Please suggest 

1 Answer

0 votes
by (73.5k points)

You can solve this problem just by installing the latest version of Mongoose. Try putting this in your package.json:

"mongoose": "~4.4"

...