I. Source code installation
1. Download the source code (visit the official website to view the latest version)
Wget http://nodejs.org/dist/v0.10.30/node-v0.10.30.tar.gz
2. Decompress the source code
Tar xzvf node-v * & cd node-v *
3. Install necessary compilation software
Sudo yum install gcc-c ++
4. Compile
./Configure
Make
5. Compile and install
Sudo make install
6. Check the version (test whether the installation is successful)
Node -- version
II. Install with compiled versions
1. Download the compiled version
The latest version can be obtained on the official website: Portal
Cd ~
Wget http://nodejs.org/dist/v0.10.30/node-v0.10.30-linux-x64.tar.gz
2. Extract
Sudo tar -- strip-components 1-xzvf node-v *-C/usr/local
3. Test and install
Node -- version
III. Install with EPEL
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. Test and install
Node -- version
4. (optional) install the npm management package
Sudo yum install npm
4. NVM installation
As the name suggests, NVM (Node version manager) is the version management software of Node. js. It can be easily switched between different versions of Node. js. The Project source code is 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 required versions
Nvm list-remote
The returned results are as follows:
...
V0.10.29
V0.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.9
V0.11.10
V0.11.11
V0.11.12
V0.11.13
3. Install the appropriate version
Nvm install v0.10.30
4. View installed versions
Nvm list
-> V0.10.30
System
5. Switch version
Nvm use v0.10.30
6. Set the default version
Nvm alias default v0.10.30