Cannot find module '/opt/render/project/src/dist/main'

…@0.0.1 start:prod
Oct 9 06:12:59 PM > node dist/main
Oct 9 06:12:59 PM
Oct 9 06:12:59 PM node:internal/modules/cjs/loader:1078
Oct 9 06:12:59 PM throw err;
Oct 9 06:12:59 PM ^
Oct 9 06:12:59 PM
Oct 9 06:12:59 PM Error: Cannot find module ‘/opt/render/project/src/dist/main’
Oct 9 06:12:59 PM at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
Oct 9 06:12:59 PM at Module._load (node:internal/modules/cjs/loader:920:27)
Oct 9 06:12:59 PM at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
Oct 9 06:12:59 PM at node:internal/main/run_main_module:23:47 {
Oct 9 06:12:59 PM code: ‘MODULE_NOT_FOUND’,
Oct 9 06:12:59 PM requireStack:
Oct 9 06:12:59 PM }

Hi there,

Based on some online research, I would take a look at your nest-cli.json file to ensure the “entryFile” field is pointed to a file that exists in that directory. The problem looks like it can’t find a file to run in dist/main. Here’s a thread that discusses the issue.

Hope that helps!

Regards,
Mike


Render Support Engineer, MT (UTC-6)

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