DEV Community

AKINRO OLAWALE
AKINRO OLAWALE

Posted on

Error: Cannot find module 'mongodb/node_modules/bson'

1 Add "mongodb": "1.4.9" to package.json and run "npm i"

2 Add "mongoose": "^4.4.12" to package.json and run "npm i"

3 run npm install inside mongodb folder

In your terminal, navigate into mongodb folder like this cd node_modules\mongodb and run "npm i"

4 Restart your serve: npm start

if all these steps still failed
Delete your node_modules and run "npm install" with your package.json intact.

Reference: [github issues ]https://github.com/Automattic/mongoose/issues/2718
Volia!!!

Top comments (0)