Remove Failed to load c++ bson extension message from MEAN.js application start

I have previously posted a How To:  install mean.js on ubuntu, In this post I will provide additional instructions on how to remove the error messages that may be displayed  when using Grunt to run your applications.

Once you have successfully completed the installation instructions contained in my previous posts  it may be possible you see error messages similar to the ones below:

This error is generally results from when installing the Mongoose Module via the Node Package Manager (npm) it does not build the BSON module in the folder.  We will need to do this ourselves manually.

Build Essentials Linux

Open terminal window (Ctrl+Alt + T ) and navigate to your project directory, or if you’re like me an you use Webstorm – The smartest JavaScript IDE you can open a terminal window with (Alt+F12 ) , and execute the following line

Once that is complete, ensure you are in the root of project folder and execute the following lines;

** Depending on your set up you may need to run these commands with super user account privileges i.e. sudo

Essentially we will delete the node_modules folder in the project root, clean the cache and then re-create the folder and modules with the correct references.

This will clear up error messages and you should now be able to continue without the nagging doubt that something is wrong with your application.

Build Essentials Windows

Since I published this post, I have noticed a number of visits from users on windows based machines and a comment from a windows user asking about a windows solution.

I must confess to the fact that I have not done any node & mongodb development using windows, and therefore I cannot attest that the following solution will work.  The following solution is entirely based on advice provided by Christian Kvalheim’s blog post , Diagnosing driver installation problems

Open visual studio command prompt. Ensure node.exe is in your path and install node-gyp.

Next you will have to build the project manually to test it. Use any tool you use with git and grab the repo.

Calvin is currently working on a fix to completely remove this conflict but due to some considerable technical challenges this may take some time.

Recommended reading
[amazon template=iframe image&asin=1449344682]
[amazon template=iframe image&asin=1491949309]
[amazon template=iframe image&asin=1782168192]
If you have any further questions please ask in the comments section below or contact me and I will endeavour to respond as soon as I can.

Gary Woodfine

Freelance Full Stack Developer at
Helps businesses by improving their technical proficiencies and eliminating waste from the software development pipelines.

A unique background as business owner, marketing, software development and business development ensures that he can offer the optimum business consultancy services across a wide spectrum of business challenges.

Affiliate Disclaimer

Disclosure: Please note that some of the links included in the blog posts are affiliate links, which means I will earn a commission if you decide to make a purchase.

I only include affiliate links to products, services and companies that I have personal experience and have actually used. I only recommend them because they are helpful and useful, not because of the small commissions I make if you decide to buy something.

Please do not spend any money on these products unless you feel they are relevant, suitable and will help you achieve your goals.

Buying anyone of these products and the commisions earned will not make me an overnite multi millionaire, but they will help to cover the hosting costs and compensate for the countless hours and effort I put in to create meaningful and valuable free content I provide to help others succeed.

You've also undoubtedly noticed that I also use various advertising networks - unless of of course you're using an Ad blocker, this is also an attempt to reduce my monthly deficit I experience in providing free relevant, valuable and on occassion insightful content for the benefit of others.

I only really make some money if people click on the ads, unless of course you consider 1c per 1000 impressions real money!

Bear in mind just how many impressions I need to make before I can cover my £20 hosting costs a month!

If you are using an adblocker and guilt stricken you can of course donate using any of the buttons below, but I won't be holding my breath.

Buy me a coffeeBuy me a coffee