It’s my first time deploying a project and I am facing an issue during deployment, So these are the steps I performed so far, I went to my cpanel root directory and cloned my git release there and I registered my application using the application manager in cpanel, I also made sure my index.js file is renamed and configured in the json file to app.js
But the app only runs when I do npm start via terminal and doesn’t run on itself or in the background I am not sure if I am missing something?
Any help on how I can solve this issue would be really appreciated,
Many thanks
cPanel runs the NodeJS app under a virtual environment, different from the standard terminal environment, that’s why it’s possible to fail start through the panel and not through the terminal.
So, is it working? Using PM2 is an “alternative” solution, but I’m failing to understand why using PM2 worked and without not.
Unfortunately, this is one of the cases where it’s hard for anyone to provide concrete feedback on your problem, we’d have to inspect every little detail about your shared hosting, starting with relevant screenshots of your cPanel and such