Install node in CentOS 6.X

Source: Internet
Author: User
Tags install node

Install node in CentOS 6.X

1. Install Source Code in Source Code
Yum-y install gcc make gcc-c ++ openssl-devel wget // yum download related dependent packages
Wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
Tar-zvxf node-v0.10.26.tar.gz
Cd node-v0.10.26
./Configure
Make & make install

2. Binaries binary Installation

You can download it through wget or directly in your browser.

After decompression, node and npm already exist in the bin folder. If you enter the corresponding file and execute the command line, there is no problem, but it is not global, so set this to global.

Cd node-v0.10.26-linux-x64/bin

Ls

./Node-v

 

The specific name of the node folder depends on your needs. Then set global: Put it under/usr/local/bin /.

Ln-s/node-v0.10.28-linux-x64/bin/node/usr/local/bin/node

Ln-s/node-v0.10.28-linux-x64/bin/npm/usr/local/bin/npm

Ln-s soft link mode

 

3. Use the Package Manager

Sudo yum install nodejs npm

It is not recommended that this method only supports version 0.12.X, and later versions 4.0 cannot be installed.

 

4. Use NVM

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.

If you want to develop a node for a long time, update the node version quickly, or switch the node version quickly, in a non-Windows (such as osx and linux) environment, use nvm to install the node development environment to keep the system clean. if you use Windows for development, you can use nvmw to replace nvm;

Install nvm first

 

We recommend that you install it under the user. If the user is root, nvm is invalid and has permissions.


Wget https://github.com/cnpm/nvm/archive/v0.23.0.tar.gz

Tar-xf v0.23.0.tar.gz // Extract

Cd nvm-0.23.0/

. /Install. sh // execute the script to create a directory under the current role. nvm folder and settings. if the/bashrc environment variable is root, it will be under/root /.

Source ~ /. Bash_profile // make the settings take effect

Nvm -- version
-> 0.23.0 // indicates the operation is successful.

Nvm list-remote // list all nodes that can be installed remotely

Nvm install vX. XX // select which one to install

Nvm ls // view the current installed version

Nvm use vX. XX // switch version

Nvm alias defaul vX. XX // sets the default version.

Nvm help // you can see the specific command through help !!

After the installation is complete, you can delete the compressed package and the file rm-rf nvm-0.23.0.

You may also like the following content about Node. js:

Install and configure Node. js v4.0.0 on Ubuntu 14.04/15.04

How to install Node. js in CentOS 7

Build a Node. js development environment in Ubuntu 14.04

Install and configure the Node. js development environment in javasru 12.04

Getting started with Node. Js [PDF + related Code]

Node. js Development Guide hd pdf Chinese version + source code

Node. js getting started Development Guide

Compile and install Node. js in Ubuntu

Node. js details: click here
Node. js: click here

This article permanently updates the link address:

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.