4 ways to install node. js on CentOS 7

Source: Internet
Author: User
Tags install node

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.