版本:v0.8.12
系统:centos5.5
出错:
python版本过低导致,升级安装
回到node-v0.8.12目录,重新安装
继续出错,如下:
这个错误是由于python中没有装bz2的库导致的
再次安装nodejs,这次正常了。
系统:centos5.5
wget http://nodejs.org/dist/v0.8.12/node-v0.8.12.tar.gz
tar -zxvf node-v0.8.12.tar.gz
cd node-v0.8.12
./configuer
make && make install出错:
configure. File "./configure", line 266 o['default_configuration'] = 'Debug' if options.debug else 'Release'
^
SyntaxError: invalid syntaxpython版本过低导致,升级安装
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
tar -zxvf Python-2.7.2.tar.bz2
cd Python-2.7.2
./configure
make && make install
#升级默认版本
mv python /usr/bin/python24
ln -s /usr/local/bin/python2.7 /usr/bin/python 回到node-v0.8.12目录,重新安装
./configuer
make && make install继续出错,如下:
Traceback (most recent call last):
File "../../tools/js2c.py", line 36, in <module>
import bz2
ImportError: No module named bz2
make[1]: *** [/home/softs/node-v0.8.12/out/Release/obj/gen/libraries.cc] Error 1
make[1]: Leaving directory `/home/softs/node-v0.8.12/out'
make: *** [node] Error 2这个错误是由于python中没有装bz2的库导致的
yum install -y bzip2*
cd Python-2.7.2/Modules/zlib
./configure
make && make install
cd Python-2.7.2/
python2.7 setup.py install 再次安装nodejs,这次正常了。
本文详细记录了在CentOS 5.5上安装Node.js v0.8.12版本时遇到的问题及解决过程,包括因Python版本过低引发的语法错误、缺少bz2模块等问题,并提供了详细的解决步骤。
1万+

被折叠的 条评论
为什么被折叠?



