To be lazy to install the stable version, simple: Yum install-y Nodejs,
Then use the following two commands to view the version, if any, the installation succeeds
Npm-v
Node-v
Next is the right way to install NODEJS8:
First step: Download Nodejs
wget https://npm.taobao.org/mirrors/node/v8.0.0/node-v8.0.0-linux-x64.tar.xz
Step Two: Unzip
TAR-XVF node-v8. 0.0-linux-x64.tar.xz
Test whether the installation was successful
Enter the directory under the Unzip directory bin to execute the ls command
CD node-v8. 0.0-linux-x64/bin && ls
有nodeAndnpm
Test
./node-v
Installation Successful
Third Step NODE environment configuration
This allows you to use/usr/local/src/in any directory.Node-v4.2.3-linux-x86/bin got the node command,
The steps are as follows:
A, switch to the root user
B, Vi/etc/profile
c. Join at the bottom
# node (annotation function)
Export Node_home=/usr/local/src/node-v4.2.3-linux-x86
Export path= $PATH: $NODE _home/bin
Export Node_path= $NODE _home/lib/node_modules
D,: Wq (Save and exit)
E, source/etc/profile (make configuration file effective)
The fourth step is accomplished.
you can use NODE-V to see your own results!
Install Nodejs v8.0.0 on CentOS