Are you running an old version? Seems that it should have been fixed here
https://github.com/Unitech/pm2/pull/1911
Edit: says merged, but seems it wasn't. Ignore
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm trying to use PM2 and make sure it's always running and restarts w/ code changes.
It looks like I need to run pm2 start /home/forge/staging.fitnessmd.fit/staging-socket.js --watch to do that, however when I set this up as a daemon I get the following error:
[PM2][Initialization] Environment variable HOME (Linux) or HOMEPATH (Windows) are not set!
[PM2][Initialization] Defaulting to /etc/.pm2
Error: EACCES: permission denied, mkdir '/etc/.pm2'
What am I doing wrong, or what is the correct way to run pm2 on Forge?
Thanks
Please or to participate in this conversation.