PM2 command not found

后端 未结 8 476
夕颜
夕颜 2020-12-24 11:37

I installed node.js and npm to my centOS 7 server. But i have problems with pm2. Actually real problem is i don\'t have experiences in linux and i don\'t know how to change

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-24 12:03

    Install PM2 globally:

    run as root:

    npm i -g pm2
    

    or if user is sudo-er

    sudo npm i -g pm2
    

    and then go back to user (or stay in root if it was created by root user) and run it:

    pm2 start server.js
    

提交回复
热议问题