1, create a folder to place node installation package in the root, and enter
mkdir local
cd local
mkdir node
cd node
2, by pulling the node xShell xz installation package
Note: the installation package address https://npm.taobao.org/mirrors/node
. 3, node extracting installation package
Note: corresponding to their own node version
xz -d node-v8.12.0-linux-x64.tar.xz
tar -xvf node-v8.12.0-linux-x64.tar
4, delete node installation package
rm -rf node-v8.12.0-linux-x64.tar
5, rename node
mv node-v.8.12.0-linux-x64.tar node-v.8.12.0
6, see your PATH variable
echo $PATH
Because for the first time on the server, nothing, so following a good set PATH create corresponding folders, here I chose the Create / root / bin folder, which is the last PATH
7, and then you create soft link
ln -s /usr/local/node/node-v8.12.0/bin/npm /root/bin/npm
ln -s /usr/local/node/node-v8.12.0/bin/node /root/bin/node
8, to test whether the installation is successful
node -v
npm -v