Error: Forever Detected Script Exited with Code: 1

Error: Forever Detected Script Exited with Code: 1

I am using forever to restart a nodejs-app in case it crashes. In some situations the app does not get restarted. Forever just displays the message:

error: Forever detected script exited with code: 1

I do not want to solve the issue within the app itself, I just need forever to restart over and over again. Maybe I am missing a paremeter?

The other questions concerning forever not restarting here on SO do not address my specific case.

1 Answer

I think I solved it:

As ist seems both parameters --minUptime and --spinSleepTime have to be set. Otherwise a so called "spinning" script will not be restarted.

So in order to restart a "spinning" script forever needs to have both parameters set like:

forever --minUptime 5000 --spinSleepTime 3000 app.js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.