Aliyun under ECS to build Node.js__js

Source: Internet
Author: User
Tags ssh node server aliyun

Nothing to do, want to build a node server, encountered a variety of pits, are now shared out

I started with CentOS 6.5.

First, start up the server in the Aliyun management console.

Second, SSH login server ssh root@ your public network IP, here I use is putty;

Third, yum first update

Yum-y Update

Four, select a node.js version.
Because my local development environment is v4.3.1, so here I personally install is (wget: In CentOS is the download command) Here you can choose any version: http://nodejs.org/dist/

wget  http://nodejs.org/dist/v4.3.1/node-v4.3.1.tar.gz

Five, then decompression:
(Here is the use of tar: http://blog.csdn.net/imyang2007/article/details/7634470)

Tar zxvf node-v4.3.1.tar.gz

Six, into the decompression directory:

CD node-v4.3.1

Seven, pre-compiling:
(Configure command to do a lot of "behind-the-scenes" work, including testing the operating system kernel and installed software, parameter analysis, the generation of intermediate directories and based on a variety of parameters to generate some C source code files, makefile files. )

./configure

Compile: (Make command compiles the project according to the makefile file generated by the Configure command and generates the target file, the final binary file.) )

Make

Nine, Installation:
(The Make install command is deployed to the specified installation directory based on the parameters of the Configure execution, including the establishment of related directories and the replication of binaries, configuration files.) )

Make install

See if the node variable is in effect:

Node-v
v4.3.1

See above to indicate successful installation

Of course, success is fortunate, and it is inevitable that it will not succeed. Error:

When I compiled the node source code on CentOS 6, I had the following error:

warning:c++ compiler too old, need g++ 4.8 or clang++ 3.4 (cxx=g++)

This is because CentOS 6 compiled node4+ requires a high version of the C + + compiler, so I upload the compiled Nodejs binary version directly. solution http://www.cnblogs.com/zzbo/p/4963137.html replace CentOS 6.5 with CentOS 7.0. If it is an Ubuntu operating system, g++: Command not Found has not installed g++, now perform installation apt-get install g++

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.