How to use pm2 on the server

express project, and then if there is anything wrong, it will cause the whole project card to fall off. How to deploy pm2 to the server? I have tried to test on this machine. The same error running the project using pm2 will not make the whole project card fall off, but I don"t know how to use it on the server

.
Mar.06,2021

the local machine and the server are the same.

use the server as you use it on this computer.


just write pm2 directly into the dependency package of package.json, and then

{
  "scripts": {
    "start": "pm2 start app.js",
    "stop": "pm2 kill"
  }
}

then use npm start and npm stop to start and stop
logs are printed in ~ / .pm2 by default, and go to the official Internet cafe for detailed configuration.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ab3b-2c24f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ab3b-2c24f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?