First, the source installation
1. Download the source code (see the latest version of the website link)
wget http://nodejs.org/dist/v0.10.30/node-v0.10.30.tar.gz
2. Extracting source code
Tar xzvf node-v* && CD node-v*
3. Install the necessary compilation software
sudo yum install gcc gcc-c++
4. Compiling
./configuremake
5. Compile & Install
sudo make install
6. View version (test installation succeeded)
Node--version
Second, install with the compiled version
1. Download the compiled version
CD ~wget http://nodejs.org/dist/v0.10.30/node-v0.10.30-linux-x64.tar.gz
2. Unzip
sudo tar--strip-components 1-xzvf node-v*-c/usr/local
3. The same way, test the installation
Node--version
Third, the use of Epel installation
1. Download Epel
sudo rpm-i http://download.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
2. Installation
sudo yum install Nodejs
3. The same way, test the installation
Node--version
4. (optional) Install the NPM Management Pack
sudo yum install NPM
Iv. installation via NVM
The NVM (Node version manager), as its name implies, is node. JS's version management software that can easily switch between various versions of node. js, Project source GitHub
1. Download and install the NVM script
Curl Https://raw.githubusercontent.com/creationix/nvm/v0.13.1/install.sh | Bash
SOURCE ~/.bash_profile
2. List the required versions
NVM list-remote
The returned results are as follows
... v0.10.29v0.10.30 v0.11.0 v0.11.1 v0.11.2 v0.11.3 v0.11.4 v0.11.5 v0.11.6 v0.11.7 v0.11.8 v0.11.9v0.11.10v0.11.11v0.11.12v0.11.13
3. Install the appropriate version
NVM Install v0.10.30
4. View the installed version
NVM List
- v0.10.30 System
5. Switch versions
NVM use v0.10.30
6. Set the default version
NVM alias Default v0.10.30
4 ways to install node. js on CentOS 7