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/node
js
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 to manually upgrade 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 website (zalou.cn)website!
Recommended Posts