When I want to use monk as a middleware to access the mongodb, it prompts that
Failed to load c++ bson extension, using pure JS version
My running evn is the following:
- OS X Yosemite
- Node v0.10.32
- npm 1.4.28
- Mongodb 2.6.5
- monk 0.9.1 Does any of you know how to fix the issue?
The Answer is in Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version
Go the the monk index.js file (
yourProjectDirectory/node_modules/monk/node_modules/mongodb/node_modules/bson/ext/index.js
)It should look like
Change the catch block to
Hope this helps
David