I am getting the below error:
{ [Error: Cannot find module \'../build/Release/bson\'] code: \'MODULE_NOT_FOUND\' }
js-bson: Failed to load c++ bson extens
In our case, the reason that the c++ version bson was not found was because we were behind a corporate proxy and something in the BSON build process needs to reach out to fetch files. When we looked in node_modules/bson/builderror.log, we saw an error like this:
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: connect ECONNREFUSED
gyp ERR! stack at errnoException (net.js:904:11)
gyp ERR! stack at Object.afterConnect [as oncomplete] (net.js:895:19)
Which suggested that the proxy might be the issue. Setting the http_proxy and https_proxy environment variables solved it.
Sorry for reawakening comments on this, but I wanted to post this for anyone else that hits this in the future since this thread was very helpful in solving our issue.