1. Download nodejs
Wget http://nodejs.org/dist/v0.10.10/node-v0.10.10.tar.gz
2. Upgrade centos 5.6 64-bit python to 2.7.3
The reason is that the Python version of centos 5.6 is 2.4.3, however, currently, many Python-based application software require python versions higher than 2.4 (for example, iotop, nodejs, and func require python versions at least 2.6)
Wget-C
Http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
Tar jxvf Python-2.7.3.tar.bz2
CD Python-2.7.3
./Configure
Make & make install
After python2.7 is installed, the default path is/usr/local/lib/python2.7.
View the Python version:
/Usr/local/bin/python2.7-V
Note:
Under normal circumstances, even if python2.7 is successfully installed, the Python version to which the system points is still 2.4.3 by default. Considering that Yum is based on python2.4.3, it can work normally and cannot be uninstalled easily. How can we point the default Python version to 2.7?
3. If you do not install Python 2.6 or later, an error will occur:
[Root @ localhost nodejs] # cd node-v0.10.10
[Root @ localhost node-v0.10.10] #./configure
File "./configure", line 434
FPU = 'vfpv3' if armv7 else 'vfpv2'
^
Syntaxerror: Invalid Syntax
4. Compile and install nodejs
Tar zxvf node-v0.10.0.tar.gz
CD node-v0.10.0
./Configure
Make
Report errors during make:
Import bz2 importerror: No module named bz2 error, which indicates that bz2 is missing
Install bz2
Yum-y install Bzip2 *
Go to the python directory, compile Python again, and then install nodejs
Then execute
CD node-v0.10.0
./Configure
Make
Make install