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++