右键,以管理员身份运行cmd工具,逐条输入如下命令行以安装PM2(前提是你安装了node)。

  1. 使用淘宝源
  2. 设置开机启动

    1. 服务模式

      1. # 安装 pm2 的服务注册命令
      2. npm install -g pm2-windows-service
      3. # 上一步执行成功之后,再执行如下命令
      4. pm2-service-install
      1. # 安装开启启动工具
      2. # 安装开启启动
      3. pm2-startup install

启动程序

进入BookStack程序所在目录,执行:

  1. pm2 start BookStack.exe

然后保存进程

执行如下命令查看系统中存在的进程:

  1. pm2 list

pm2 详细教程

如果嫌弃以上操作麻烦,请创建一个.bat文件,如install-pm2.bat,然后将下面的内容粘贴进去。然后再Windows系统中右键点击,以管理员身份运行

  1. call npm config set registry https://registry.npm.taobao.org
  2. call npm install -g pm2
  3. call npm install -g pm2-windows-service

非服务模式

  1. call npm config set registry https://registry.npm.taobao.org
  2. call npm install -g pm2
  3. call npm install -g pm2-windows-startup
  4. call pm2-startup install

常用基本命令

  1. pm2 restart BookStack

停止程序

  1. pm2 restart BookStack

查看进程日志

  1. pm2 logs BookStack
  1. pm2 del BookStack

App BookStack differs

报类似这样的错误: Current process list running is not in sync with saved list. App BookStack differs. Type ‘pm2 save’ to synchronize.

  1. pm2 update
  2. pm2 list

参考: