linux 安装node.js
linux 安装node.js
1.下载node.js最新稳定版本
2.解压,编译,安装
如下命令(以我本机目录)
#cd /usr/local/node-V0.4.8
#./configure
#make
#make install
安装依赖python包,如果你的python版本过低,会报下面编译错误
File "/home/bennybobw/sources/node-v0.2.4/tools/waf-light", line 157, in ?
import Scripting
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/Scripting.py", line 9, in ?
import Utils, Configure, Build, Logs, Options, Environment, Task
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/Build.py", line 18, in ?
import Runner, TaskGen, Node, Scripting, Utils, Environment, Task, Logs, Options
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/TaskGen.py", line 54, in ?
class task_gen(object):
File "/home/bennybobw/sources/node-v0.2.4/tools/wafadmin/TaskGen.py", line 87, in task_gen
traits = Utils.DefaultDict(set)
NameError: name 'set' is not defined
解决办法,下载python2.6并安装,由于linux默认安装python2.3版本,安装后在命令行执行#python命令,看到仍是旧版本
进入/usr/bin目录,删除旧的文件链接,关联新的版本链接如下:
#cd /usr/bin
#ll |grep python
#rm -f python
#ln -s /usr/local/Python-2.6/python ./python
重新编译安装node.js即可。
更多推荐
所有评论(0)