Question

Can't use mongodb

  • Posted January 16, 2014

Hi! I have ubuntu on my droplet and can’t use mongodb for some reason on my nodejs server. I have message “Failed to load c++ bson extension, using pure JS version” in console, but nothing is working after that.

Subscribe
Share

this is a huge nasty bug since a year or so. you have to use an ancient version of node and reinstall everything clean. its still a problem with node 4.0. iojs 2.4 is the only version i’ve got this to work.

rm -rf node_modules npm cache clean

npm install mongodb --mongodb:native npm install


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Run npm update and it’ll disappear.

How did you solve this?!

oh sorry, I’ve found the problem and it’s not in mongo

<blockquote>I have message “Failed to load c++ bson extension, using pure JS version” in console</blockquote>That’s fine, it means that it successfully fell back to the JS version of the driver instead of the native c++ driver. <br> <br><blockquote>but nothing is working after that.</blockquote>What do you mean? Can you pastebin your code?