Mongodb Not found error after successful deployment of application

Error: Cannot find module ‘mongodb’
Dec. 3 02:30:36 PM Require stack:
Dec. 3 02:30:36 PM - /opt/render/project/src/node_modules/connect-mongo/build/main/lib/MongoStore.js
Dec. 3 02:30:36 PM - /opt/render/project/src/node_modules/connect-mongo/build/main/index.js
Dec. 3 02:30:36 PM - /opt/render/project/src/app.js
Dec. 3 02:30:36 PM - /opt/render/project/src/bin/www
Dec. 3 02:30:36 PM at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
Dec. 3 02:30:36 PM at Function.Module._load (internal/modules/cjs/loader.js:730:27)
Dec. 3 02:30:36 PM at Module.require (internal/modules/cjs/loader.js:957:19)
Dec. 3 02:30:36 PM at require (internal/modules/cjs/helpers.js:88:18)
Dec. 3 02:30:36 PM at Object. (/opt/render/project/src/node_modules/connect-mongo/build/main/lib/MongoStore.js:28:19)
Dec. 3 02:30:36 PM at Module._compile (internal/modules/cjs/loader.js:1068:30)
Dec. 3 02:30:36 PM at Object.Module._extensions…js (internal/modules/cjs/loader.js:1097:10)
Dec. 3 02:30:36 PM at Module.load (internal/modules/cjs/loader.js:933:32)
Dec. 3 02:30:36 PM at Function.Module._load (internal/modules/cjs/loader.js:774:14)
Dec. 3 02:30:36 PM at Module.require (internal/modules/cjs/loader.js:957:19) {
Dec. 3 02:30:36 PM code: ‘MODULE_NOT_FOUND’,
Dec. 3 02:30:36 PM requireStack: [
Dec. 3 02:30:36 PM ‘/opt/render/project/src/node_modules/connect-mongo/build/main/lib/MongoStore.js’,
Dec. 3 02:30:36 PM ‘/opt/render/project/src/node_modules/connect-mongo/build/main/index.js’,
Dec. 3 02:30:36 PM ‘/opt/render/project/src/app.js’,
Dec. 3 02:30:36 PM ‘/opt/render/project/src/bin/www’
Dec. 3 02:30:36 PM ]
Dec. 3 02:30:36 PM }
Dec. 3 02:30:36 PM npm ERR! code ELIFECYCLE
Dec. 3 02:30:36 PM npm ERR! errno 1
Dec. 3 02:30:36 PM npm ERR! vijaypyrotech@0.0.0 start: node ./bin/www
Dec. 3 02:30:36 PM npm ERR! Exit status 1
Dec. 3 02:30:36 PM npm ERR!
Dec. 3 02:30:36 PM npm ERR! Failed at the vijaypyrotech@0.0.0 start script.
Dec. 3 02:30:36 PM npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

My application runs locally fine but while trying to deploy, this error shows while launching application. Please help me with this

Hi there,

MODULE_NOT_FOUND errors imply you haven’t installed your dependencies. Either at all, (e.g. missing npm install) or that the package is in your devDependencies and you need to either move it to dependencies or include the devDependencies in your install (npm install docs)

Hope that helps

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.