---
title: "Nodejs v0.8.12安装"
author: "flyer2010"
date: "2012-10-17T10:31:00Z"
tags: ["nodeJs"]
categories: ["互联网"]
slug: "nodejs-v0-8-12"
draft: false
lastmod: "2012-10-17T10:31:00Z"
id: 1699946
url: "https://flyer2010.iteye.com/blog/1699946"
---

版本：v0.8.12 系统：centos5.5 \[code="java"]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\[/code] 出错： \[code="java"]configure. File "./configure", line 266 o\['default\_configuration'] = 'Debug' if options.debug else 'Release' ^ SyntaxError: invalid syntax\[/code] python版本过低导致，升级安装 \[code="java"]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 \[/code] 回到node-v0.8.12目录，重新安装 \[code="java"]./configuer make && make install\[/code] 继续出错，如下： \[code="java"]Traceback (most recent call last): File "../../tools/js2c.py", line 36, in 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\[/code] 这个错误是由于python中没有装bz2的库导致的 \[code="java"]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 \[/code] 再次安装nodejs，这次正常了。