无法使用纯JS版本加载c ++ bson扩展

时间:2014-04-21 02:53:18

标签: node.js mongodb express

justhacker@justhacker-ThinkPad-Edge-E440:~/tools/codes/microblog$ node app.js 
Failed to load c++ bson extension, using pure JS version 

/home/justhacker/tools/codes/microblog/node_modules/express/lib/express.js:89       

throw new Error('Most middleware (like ' + name + ') is no longer bundle             ^ 

Error: Most middleware (like session) is no longer bundled with Express and must be 

installed separately. Please see https://github.com/senchalabs/connect#middleware.     

at Function.Object.defineProperty.get 

(/home/justhacker/tools/codes/microblog/node_modules/express/lib/express.js:89:13)     

at module.exports (/home/justhacker/tools/codes/microblog/node_modules/connect-

mongo/lib/connect-mongo.js:30:22)     

at Object.<anonymous> (/home/justhacker/tools/codes/microblog/app.js:14:42)     

at Module._compile (module.js:449:26)     

at Object.Module._extensions..js (module.js:467:10)     

at Module.load (module.js:349:32)     

at Function.Module._load (module.js:305:12)     

at Function.Module.runMain (module.js:490:10)     

at startup (node.js:124:16)     

at node.js:807:3

2 个答案:

答案 0 :(得分:0)

当您使用npm安装bson模块时,听起来没有安装gcc / g ++ / make / python 2.x。首先尝试安装它们,然后使用npm重新安装bson。

答案 1 :(得分:0)

实际错误是由4.0版本中的快速更改引起的。大多数包含的中间件现在都是“独立”的npm包。您可以阅读有关更改的更多信息here

关于Failed to load c++ bson extension, using pure JS version.错误,您可能缺少python / gcc。 您可以在此处详细了解此错误:node.js - Failed to load c++ bson extension。如果这不能解决您的问题,请尝试删除/重新安装驱动程序/插件。