Find the corresponding nodejs package, refer to https://nodejs.org/download/release/
Switch to the location where node is installed here is /usr/local/lib/nodejs
Does not exist can be established
mkdir /usr/local/lib/nodejs
wget node-v8.12.0-linux-x64.tar.xz
tar -xJvf node-8.12.0-linux-x64.tar.xz -C /usr/local/lib/nodejs
mv /usr/local/lib/nodejs/node-8.12.0-linux /usr/local/lib/nodejs/node-8.12.0
vim ~/.profile
Enter the following
export NODEJS_HOME=/usr/local/lib/nodejs/node-8.12.0/bin
export PATH=$NODEJS_HOME:$PATH
~ /.profile
node -v
sudo ln -s /usr/local/lib/nodejs/node-8.12.0/bin/node /usr/bin/node
sudo ln -s /usr/local/lib/nodejs/node-8.12.0/bin/npm /usr/bin/npm
sudo ln -s /usr/local/lib/nodejs/node-8.12.0/bin/npx /usr/bin/npx
to sum up
The above is the method for manually upgrading the node version under CentOs introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!
Recommended Posts