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.