The most concise command input
yum -y update
yum -y install gcc make gcc -c ++ openssl -devel wget vim (if the latter two are not selected for installation)
cd /usr/local/src
wget https://nodejs.org/dist/v8.11.1/node-v8.11.1.tar.gz
tar xvzf node-v8.11.1 .tar .gz cd node -v8 .9 .4
mv node-v8.11.1 node
./configure --prefix=/usr/local/node
sudo make && makeinstall
vim /etc/profile (enter i edit mode after entering the file)
Move to file last input
- #set for nodejs
- export NODE_HOME=/usr/local/node
- export PATH=$NODE_HOME/bin:$PATH
source /etc/profile
node -v (the corresponding version number appears: 8.11.1 )
Introduce the version with a picture (the server chooses to install Source Code to choose the version)
Be sure to install gcc make gcc -c ++ if you don't you will get an error at the end of the make command