ECS cloud server node deployment projects, use pm2 persistence up and running

A, node project deployment: https: //help.aliyun.com/document_detail/50775.html spm = a2c4g.11174283.6.1137.74eb52fe7cM4lo?

 1. Official Document Actions error Solution

  Note : the lower the official documentation installed version does not support es6 new syntax, find linux download the latest version of the corresponding node in the official website ;

  Tip: Create a soft link, suggesting that file already exists, you can simply create a soft link in / usr / local, and then move the mouse to the corresponding file /usr/local/bin/

Two, node start

  1. Create a directory node node project placed in the root directory, cd node, node app.js to start the service;

    Defects: After closing the remote connection, the service is automatically disconnected;

  2. Use pm2 opening period starts, after the remote disconnection can still run

    npm install -g pm2

      Create a soft link: ln -s /root/node-v12.14.0-linux-x64/bin/pm2 / usr / local / bin / pm2

    Note: /root/node-v12.14.0-linux-x64/bin/pm2 installation directory for your version node

    Start: pm2 start app.js

    Boot from the start: pm2 startup

 

 

    

  

Guess you like

Origin www.cnblogs.com/changyaoself/p/12124766.html