Install Nodejs on Linux (you want to learn Nodejs on Linux)

Source: Internet
Author: User

Description

Use the CentOS system for Nodejs installation, Nodejs version-v0.8.7.

1, first download Nodejs:

# wget http://nodejs.org/dist/v0.8.7/node-v0.8.7.tar.gz

2, unzip the file

# tar XVF node-v0.8.7.tar.gz

3, go to unzip directory

# CD node-v0.8.7

4, check the required configuration

#./configure

An error message appears:

Exception:call to ' (Echo | $ (Echo ${cxx_host:-$ (which g++)})-m32-e-

>/dev/null 2>&1) && echo "-m32" | | True ' returned exit status 0. While

Loading dependencies Of/opt/node-v0.8.7/node.gyp while trying to load

/opt/node-v0.8.7/node.gyp

5, if the above error occurs, install gcc-c++

# yum Install gcc-c++

6, for installation (long time):

# make Install

7, check whether the installation is successful, enter the command:

# node-v

If the installation succeeds, the corresponding version number is output, such as:

v0.8.7

8, you can now create a test.js file to test, the file content is: Console.log (' Hello world ');

Enter the command:

# node Test.js

Output:

Hello World.

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.