Next.js Discord

Discord Forum

NextJS/PM2 problem shutting down after a few hours/days

Unanswered
English Angora posted this in #help-forum
Open in Discord
English AngoraOP
I am having problems with NextJS webpage shutting down after sometime it is running like it runs for a few days and it randomly shuts down.

I use PM2 on ubuntu to run it i setup all the watch thing and stuff to keep it running if any error occurs

sometimes it gives this error but mosly it doesn't give error just randomly shuts down app but it says it is still running in pm2. Nginx is still running in background and working

Error:
Script /root/.nvm/versions/node/v20.5 .1/bin/npm had too many unstable restarts (16). Stopped. "errored"

My app.config
pm2 start myapp.config.js

module.exports = {
  apps: [
    {
      name: "websitename",
      script: "npm",
      args: "run start",
      cwd: "./websitefolder",
      watch: true,
      env: {
        NODE_ENV: "production"
      }
    }
  ]
}

0 Replies