右键,以管理员身份运行cmd
工具,逐条输入如下命令行以安装PM2(前提是你安装了node)。
- 使用淘宝源
设置开机启动
服务模式
# 安装 pm2 的服务注册命令
npm install -g pm2-windows-service
# 上一步执行成功之后,再执行如下命令
pm2-service-install
-
# 安装开启启动工具
# 安装开启启动
pm2-startup install
启动程序
进入BookStack程序所在目录,执行:
pm2 start BookStack.exe
然后保存进程
执行如下命令查看系统中存在的进程:
pm2 list
pm2 详细教程
如果嫌弃以上操作麻烦,请创建一个.bat
文件,如install-pm2.bat
,然后将下面的内容粘贴进去。然后再Windows系统中右键点击,以管理员身份运行
。
call npm config set registry https://registry.npm.taobao.org
call npm install -g pm2
call npm install -g pm2-windows-service
非服务模式
call npm config set registry https://registry.npm.taobao.org
call npm install -g pm2
call npm install -g pm2-windows-startup
call pm2-startup install
常用基本命令
pm2 restart BookStack
停止程序
pm2 restart BookStack
查看进程日志
pm2 logs BookStack
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.
pm2 update
pm2 list
参考:https://github.com/Unitech/pm2/issues/4556#issuecomment-607152306