pm2
pm2 copied to clipboard
post deploy hook failed- bash: npm: command not found
What's going wrong?
When deploying to a remote machine using pm2 deploy server
if fails on the post deploy hook where I am running the following
'post-deploy': `npm install && pm2 startOrRestart ecosystem.config.js --update-env --env development`,
Results in "
○ executing post-deploy `npm install && pm2 startOrRestart ecosystem.config.js --update-env --env development`
bash: npm: command not found
post-deploy hook failed
Deploy failed
Deploy failed with exit code: 1
I can SSH into the machine and manually run the commands in the post-deploy hook and they work fine. It just doesn't work when deploying. This is one of 4 environments of essentially identical machines in the same ecosystem.config.js file, only this one has an issue. Not sure where to start.
Same problem here. Any news about it?
I have the same issue. My prod server deploys with no errors but not my dev server. On Dev server running: Ubuntu 22.04.1 LTS PM2 5.2.2
On Prod server running: Ubuntu 18.04.6 LTS PM2 3.4.1
Any news ?