I have application deployed on Ubuntu 16.04 with node js, mongodb, mongoose & express js. Until y’day my app was up and running with no issues. When I pushed the updates to server and restarted the server using pm2 it started giving below error :
Error: Cannot find module ‘mongodb’ at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Function._load (/usr/local/lib/node_modules/pm2/node_modules/pmx/lib/transaction.js:62:21) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (/home/sumit/www/bulawaa/node_modules/mongoose/lib/drivers/node-mongodb-native/binary.js:6:14) at Module._compile (module.js:409:26) at Object.Module._extensions…js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12)
I have mongoose npm package installed, trying to figure out what changed in mongodb drivers that is causing this issue. Due to this my app is down.
Can some one help me get to the cause. Look forward to hear from you.
Kind Regards, Sumit
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.
Click below to sign up and get $100 of credit to try our products over 60 days!