1, novice server with mirror [pagoda] bar

Install nodejs

Log in to the SSH server as user root

To obtain the Linux installation package, go to nodejs.org/zh-cn/downl… Select the Linux binary and copy the download link on your browser

Download nodeJS on the server and unzip it

CD/home wget https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz version may be updated, Replace it with the version you downloaded: tar XVF node-v12.13.0-linux-x64.tar.xzCopy the code

After the decompression is complete, delete the package, and then decompress the directory to rename

Rm node-v12.13.0-linux-x64.tar.xz mv node-v12.13.0-linux-x64 nodejsCopy the code

Add the node and NPM commands to the global

ln -s /home/nodejs/bin/node /usr/local/bin/node
ln -s /home/nodejs/bin/npm /usr/local/bin/npm
Copy the code

Test the

cd /
node -v
Copy the code

Install git

Directly in the home directory

yum install git 
git -v
Copy the code

Install the pm2

NPM install -g pm2 install -g pm2 install -g pm2 install -g pm2 install -g pm2 installCopy the code

Use PM2 to get our NUXT project running

cd /var/www/my-nuxt && pm2 start npm -- run start
pm2 list
Copy the code

Steps taken together

The project stopped, Pm2 list pm2 delete all git pull NPM run build CD/WWW /wwwroot/nuxt_project/mnm-vidamii-nuxt && pm2 start NPM -- run startCopy the code
pm2 delete all && git pull && npm run build && pm2 start npm -- run start
Copy the code