2014-04-21 96 views
1
[email protected]:~/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 

回答

0

聽起來像是你沒有GCC/G ++ /讓當你使用NPM安裝BSON模塊安裝/蟒蛇2.x的。嘗試先安裝它們,然後使用npm重新安裝bson。

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。如果這不能解決您的問題,請嘗試刪除/重新安裝驅動程序/插件。