首页 > 代码库 > failed to load c++ bson extension using pure js version

failed to load c++ bson extension using pure js version

When you installed the mongoose module by npm, it hasn‘t build bson module within it‘s forlder. see the file ‘node_modules/mongoose/node_modules/mongodb/node_modules/bson/ext/index.js‘

bson = require(‘../build/Release/bson‘);

bson = require(‘../build/Release/bson‘);

So just change it to bson = require(‘bson‘); 

bson = require(‘bson‘);

and install bson module by npm.

 

这里说的很明白,唯一不同的是这个index.js的位置,可能不是上面说的结构,但是一定是在node_modules中的,慢慢找找,找到后按照上面说的,就ok了。

failed to load c++ bson extension using pure js version