It's throwing an error while deploying

==> Using Node version 18.16.0 via /opt/render/project/src/package.json

Feb 5 05:44:24 PMINFO==> Docs on specifying a Node version: Setting Your Node.js Version | Render Docs

Feb 5 05:44:26 PMINFO==> Running build command ‘npm install’…

Feb 5 05:44:28 PMINFO

Feb 5 05:44:28 PMINFOadded 28 packages, and audited 442 packages in 1s

Feb 5 05:44:28 PMINFO

Feb 5 05:44:28 PMINFO47 packages are looking for funding

Feb 5 05:44:28 PMINFO run npm fund for details

Feb 5 05:44:28 PMINFO

Feb 5 05:44:28 PMINFOfound 0 vulnerabilities

Feb 5 05:44:29 PMINFO==> Uploading build…

Feb 5 05:44:38 PMINFO==> Build uploaded in 8s

Feb 5 05:44:38 PMINFO==> Build successful :tada:

Feb 5 05:44:40 PMINFO==> Deploying…

Feb 5 05:44:56 PMINFO==> Using Node version 18.16.0 via /opt/render/project/src/package.json

Feb 5 05:44:56 PMINFO==> Docs on specifying a Node version: Setting Your Node.js Version | Render Docs

Feb 5 05:44:59 PMINFO==> Running ‘node server.js’

Feb 5 05:45:01 PMINFOnode:internal/modules/cjs/loader:571

Feb 5 05:45:01 PMINFO throw e;

Feb 5 05:45:01 PMINFO ^

Feb 5 05:45:01 PMINFO

Feb 5 05:45:01 PMERRORError: Cannot find module ‘/opt/render/project/src/node_modules/@mongodb-js/saslprep/dist/node.js’

Feb 5 05:45:01 PMINFO at createEsmNotFoundErr (node:internal/modules/cjs/loader:1096:15)

Feb 5 05:45:01 PMINFO at finalizeEsmResolution (node:internal/modules/cjs/loader:1089:15)

Feb 5 05:45:01 PMINFO at resolveExports (node:internal/modules/cjs/loader:565:14)

Feb 5 05:45:01 PMINFO at Module._findPath (node:internal/modules/cjs/loader:634:31)

Feb 5 05:45:01 PMINFO at Module._resolveFilename (node:internal/modules/cjs/loader:1061:27)

Feb 5 05:45:01 PMINFO at Module._load (node:internal/modules/cjs/loader:920:27)

Feb 5 05:45:01 PMINFO at Module.require (node:internal/modules/cjs/loader:1141:19)

Feb 5 05:45:01 PMINFO at require (node:internal/modules/cjs/helpers:110:18)

Feb 5 05:45:01 PMINFO at Object. (/opt/render/project/src/node_modules/mongodb/lib/cmap/auth/scram.js:4:20)

Feb 5 05:45:01 PMINFO at Module._compile (node:internal/modules/cjs/loader:1254:14) {

Feb 5 05:45:01 PMINFO code: ‘MODULE_NOT_FOUND’,

Feb 5 05:45:01 PMINFO path: ‘/opt/render/project/src/node_modules/@mongodb-js/saslprep/package.json’

Feb 5 05:45:01 PMINFO}

1 Like

Hi,

Maybe you’ve committed your node_modules folder?

That’s not recommended. Not having it committed ensures your dependencies are installed appropriately for the destination environment.

Alan

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