Open dzek69 opened 3 years ago
In my case, switching from running the script with yarn to npm worked.
@cwagner22 you mean installing pm2 globally with npm instead of yarn?
I use pm2 to run a command inside my package.json.
pm2 start yarn --name test -- start
I changed to:
pm2 start npm --name test -- start
Maybe it doesn't apply to you.
i don't do that, as I said i run the app with pm2 start file.js
In my case, switching from running the script with yarn to npm worked.
It appears that this only works if you're not using pm2 in yarn workspaces
Does anybody solve the problem? i am having the same issue.
same problem here. My fastify backend crashes and pm2 decides not to do anything
What's going wrong?
PM2 by default should restart my app from what I know. However it doesn't restart the app if error is thrown in top level code, like:
file.js
How could we reproduce this issue?
Create file as above. Run
pm2 start file.js
Usepm2 list
to see that app is not restarting and it's "online"Supporting information
I first discovered this on my Raspberry, i thought it may be some issue with the OS, Node version or something, but I tested it on my local PC and it's the same. Even old version (4.4.1) is behaving the same, so this must be a long living bug I guess.
I tried changing the code to:
and then it works as expected