'pm2 crash with too many unstable restarts (16). Stopped. "errored" in python

I have created a script that can run the python django application. I run this script using pm2. I do pm2 start scripts.sh, it works properly but after some time my application doesn't work and displays an error like this

the runtime process for the instance running on port 37001 has unexpectedly quit**

I show the log using pm2 logs, it displays an error like this

script.sh had too many unstable restarts (16). Stopped. "errored"

How to resolved it? Can anyone help me?



Solution 1:[1]

I had the same issue and resolved with: pm2 kill rm -rf node_modules npm i pm2 start index.js

sudo shutdown -r now

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Translator_Ziat