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

前端 未结 30 2352
予麋鹿
予麋鹿 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:59

    So, i have the same problem and it happens then the specified mongoDB URL doesn't exist. So, to fix this you need to go "..\server\config\environment" folder and edit in "development.js" file the link to mongoDB.

    Example:

    // Development specific configuration
    // ==================================
    module.exports = {
      // MongoDB connection options
      mongo: {
        uri: 'mongodb://localhost/test2-dev'
      },
    
      seedDB: true
    };
    

    So, change this "uri: 'mongodb://localhost/test2-dev'" to some real path to your mongoDB database.

    I will be glad if my post will help somebody...

提交回复
热议问题