I have build the NestJS project and all folders except node_modules have been compressed into zip and then uploaded to cpanel.
NPM install has also been done in the nodejs app in cpanel. But when I test the NestJS URL it return code 503.
I checked stderr.log and found an error like this
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module '@nestjs/core'
Require stack:
- /home/susa7462/public_html/nextjs.susatyo.com/dist/main.js
- /usr/local/lsws/fcgi-bin/lsnode.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/susa7462/public_html/nextjs.susatyo.com/dist/main.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19) {
code: 'MODULE_NOT_FOUND',
I’m using node 12.22.9
this is my folder structure
enter image description here
and this is my nodejs app in cpanel
enter image description here
I tried to change node version to 20.9.0 it still return error 503, what am I doing wrong?
Gelorawan Susatyo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.