-pm2: command not found 报错

root下运行

npm i -g pm2

or

sudo npm i -g pm2

然后测试pm2 是否安装可行

 pm2 start server.js