1
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
Neil Lunn
  • 148,042
  • 36
  • 346
  • 317
edagarli
  • 43
  • 2
  • 8

2 Answers2

0

Sounds like you didn't have gcc/g++/make/python 2.x installed when you used npm to install the bson module. Try installing them first and then use npm to reinstall bson.

mscdex
  • 104,356
  • 15
  • 192
  • 153
0

The actual error is caused by express changes in 4.0 version. Most of the included middlewares now come as "stand-alone" npm packages. You can read more about the changes here.

About the Failed to load c++ bson extension, using pure JS version. error, you're probably missing python/gcc. You can read more about this error here: node.js - Failed to load c++ bson extension. If this don't fix your issue, try removing/reinstalling the driver/plugin.

Community
  • 1
  • 1
Deepsy
  • 3,769
  • 7
  • 39
  • 71