您的位置:首页 > Web前端 > Node.js

Ubuntu 12.04安装nodejs折腾记

2013-06-26 11:43 369 查看
以前在centos上安装,ubuntu安装,从来没有像这次这么折腾,可能是刚来工作单位的原因吧....

wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz[/code] 
解压、编译
tar xzvf Python-2.7.3
cd Python-2.7.3
./configure
make && make install

首先下载node最新的源码包wget http://nodejs.org/dist/v0.8.11/node-v0.8.11.tar.gz
解压,然后开始编译
tar -zxf node-v0.8.11.tar.gz
cd node-v0.8.11
./configure
总之出现了一个以前没有出现的错误,叫
ImportError: No module named bz2
终于让我发现了答案:[/code]
This is related to issue #2316I followed the README for recent node versions stating that python 2.6 or 2.7 is needed, and then I spent quite a long time before succeeding to compile Python with bz2Maybe it's specific to my environment and I don't install unix stuff everyday but I think the README desserves at least a mention in case of python/bz2 installation problem and at least links to these two bugsIn my case, it was solved following this :http://stackoverflow.com/questions/812781/pythons-bz2-module-not-compiled-by-default
http://www.kelvinwong.ca/2010/08/02/python-2-7-on-dreamhost/But both methods are not totally correct (in my case at least), the correct sequence is more something like (sorry for the imprecision but I spent enough time on this, probably some people can correct easily if needed) :wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar xpzf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6
make -f Makefile_libbz2_so
make
make install PREFIX=/usr/local
cp ./libbz2.so.1.0.6 /usr/local/libcd Python-2.7.3
./configure --prefix=/usr/local
make install
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: