Question
Issue with PM2 file recognition
Howdy y'all,
I was following the Getting started after deploying NodeJS guide provided after setting up a Node.js Droplet and trying to get my personal website deployed. While I was trying to schedule my app.js to pm2, I encountered the following error:
root@DropletProjName:~/danaimone.com# sudo -u nodejs pm2 start app.js
[PM2][ERROR] Script not found: /root/danaimone.com/app.js
If I try to do a pm2 start app.js while logged in as root, without switching to the nodejs user, it adds fine. Unfortunately, this problem is interfering with deployment to the web since the nodejs user handles pm2 directly. I’m not sure if it’s because the folder is cloned on root and pm2 is not able to get the specific path. I tried an absolute path (/root/danaimone.com/app.js, /root/danaimone.com/app) to no success. I would appreciate any help y'all can provide on this!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×