NodeJS installation and deployment (Linux systems)

Environment Description: Linux environment, CentOS 7 version.

Step One: Download node address: https://nodejs.org/en/download/

After downloading, it is a [node-v10.16.0-linux-x64.tar.xz] folder, to decompress:

an xz - D # .xz XX.xz command extracting 
the tar - xvf .tar XX.tar # decompression command 

[nodejs the root @ localhost] # LS 
Node -v10. 16.0 -linux-x64-Node-V10. 16.0 -linux-x64.tar

Step Two: Configure environment variables

1 , switch to the root account 
2, VI / etc / Profile, into the document at the end, two additional paths, as follows:
export NODEJS_HOME=/root/apps/nodeJs/node-v10.16.0-linux-x64
export PATH=$PATH:$NODEJS_HOME/bin
3, source / etc / profile, file take effect! 
4, verify the results:
[root@localhost /]# node -v
v10.16.0

Guess you like

Origin www.cnblogs.com/lelelong/p/10971619.html