安装nodejs和yarn的命令:

curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo

curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
//参见:https://github.com/nodesource/distributions

sudo yum install yarn

安装pm2

yarn global add pm2

配置package.json
后台静默启动的快捷命令:

"scripts": {
        "start": "pm2 start index.js --watch --name redredstar",
    },

pm2的日志文件:/root/.pm2/logs下面

查看服务器上运行的NODE服务,执行:pm2 list
删除一个服务,执行pm2 delete [appName]
 

相关文章:

  • 2021-05-16
  • 2021-05-08
  • 2021-07-16
  • 2021-10-23
  • 2021-10-04
  • 2022-12-23
  • 2022-01-07
猜你喜欢
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
相关资源
相似解决方案