Hi everybody
I am trying to deploy my NestJS project. Everything is fine until ‘npm run start:prod’ where I get the following error.
My code is based in a monorepo and the folder is /backend .
I have added that as a rootDir,
Can you help me figuring out what is wrong?
Apr 19 04:58:13 PM ==> Starting service with 'npm run start:prod'
Apr 19 04:58:15 PM
Apr 19 04:58:15 PM > insurance_backend@0.0.1 start:prod /opt/render/project/src/backend
Apr 19 04:58:15 PM > node dist/main
Apr 19 04:58:15 PM
Apr 19 04:58:15 PM internal/modules/cjs/loader.js:888
Apr 19 04:58:15 PM throw err;
Apr 19 04:58:15 PM ^
Apr 19 04:58:15 PM
Apr 19 04:58:15 PM Error: Cannot find module '/opt/render/project/src/backend/dist/main'
Apr 19 04:58:15 PM at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
Apr 19 04:58:15 PM at Function.Module._load (internal/modules/cjs/loader.js:730:27)
Apr 19 04:58:15 PM at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
Apr 19 04:58:15 PM at internal/main/run_main_module.js:17:47 {
Apr 19 04:58:15 PM code: 'MODULE_NOT_FOUND',
Apr 19 04:58:15 PM requireStack: []
Apr 19 04:58:15 PM }
Apr 19 04:58:15 PM npm ERR! code ELIFECYCLE
Apr 19 04:58:15 PM npm ERR! errno 1
Apr 19 04:58:15 PM npm ERR! insurance_backend@0.0.1 start:prod: `node dist/main`
Apr 19 04:58:15 PM npm ERR! Exit status 1
Apr 19 04:58:15 PM npm ERR!
Apr 19 04:58:15 PM npm ERR! Failed at the insurance_backend@0.0.1 start:prod script.
Apr 19 04:58:15 PM npm ERR! This is probably not a problem with npm. There is likely additional logging output above.