warning: 这篇文章距离上次修改已过1548天,其中的内容可能已经有所变动。

Nginx下启动PM2项目

1.上传文件到网站目录

.nuxt
static
nuxt.config.js
package.json
package-lock.json
  1. 切换到对应目录
    cd /home/wwwroot/test/
  2. 安装对应组件
    npm install -production
  3. 启动 npm 服务
    npm start
  4. 创建并启动PM2项目
    pm2 start --name 'test' npm -- run start
  5. 开启进程守护
    pm2 save