Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (47.6k 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 (106k points)

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

"mongoose": "~4.4"

Related questions

Browse Categories

...