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

前端 未结 30 2336
予麋鹿
予麋鹿 2020-11-28 02:19

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         


        
30条回答
  •  情话喂你
    2020-11-28 02:43

    Unfortunately, All the above answers are only half right.. Took a long time to figure this out..

    Mongoose bson install via npm throws warning and causes the error...

    npm install -g node-gyp
    
    git clone https://github.com/mongodb/js-bson.git
    cd js-bson
    npm install
    node-gyp rebuild
    

    This works like magic!!

提交回复
热议问题