{ [Error: Cannot find module ‘…/build/Release/bson’] code: ‘MODULE_NOT_FOUND’ }
js-bson: Failed to load c++ bson extension, using pure JS version { [Error: Cannot find module ‘…/build/Release/bson’] code: ‘MODULE_NOT_FOUND’ }
js-bson: Failed to load c++ bson extension, using pure JS version { [Error: Cannot find module ‘…/build/Release/bson’] code: ‘MODULE_NOT_FOUND’ }
js-bson: Failed to load c++ bson extension, using pure JS version { [Error: Cannot find module ‘…/build/Release/bson’] code: ‘MODULE_NOT_FOUND’ }
js-bson: Failed to load c++ bson extension, using pure JS version D:\blog\models\db.js:5 e.exports = new Db(settings.db, new Server(settings.host, Connection.DEFAULT_P ^ TypeError: Cannot read property ‘DEFAULT_PORT’ of undefined at Object.<anonymous> (D:\blog\models\db.js:5:76) at Module._compile (module.js:460:26) at Object.Module._extensions…js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (D:\blog\models\user.js:1:75) at Module._compile (module.js:460:26) at Object.Module._extensions…js (module.js:478:10)
换linux环境
我遇到过类似问题,是在升级node之后。 npm rebuild [module-name] 就好了