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

Ubuntu 编译安装node.js

2013-10-09 16:51 423 查看
到node.js网站下载最新压缩包,然后解压到/opt目录下。
安装GCC后,运行./configure --prefix=/usr, 我试过在Ubuntu 13.10上用clang 3.4,编译也是可以的。
root@html5viewer1:/opt/node-v0.10.20# ./configure --prefix=/usr
{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': []},
'variables': { 'clang': 0,
'gcc_version': 48,
'host_arch': 'x64',
'node_install_npm': 'true',
'node_prefix': '',
'node_shared_cares': 'false',
'node_shared_http_parser': 'false',
'node_shared_libuv': 'false',
'node_shared_openssl': 'false',
'node_shared_v8': 'false',
'node_shared_zlib': 'false',
'node_tag': '',
'node_unsafe_optimizations': 0,
'node_use_dtrace': 'false',
'node_use_etw': 'false',
'node_use_openssl': 'true',
'node_use_perfctr': 'false',
'node_use_systemtap': 'false',
'python': '/usr/bin/python',
'target_arch': 'x64',
'v8_enable_gdbjit': 0,
'v8_no_strict_aliasing': 1,
'v8_use_snapshot': 'true'}}
creating ./config.gypi
creating ./config.mk
root@html5viewer1:/opt/
然后开始编译,成功后安装,我都是在root用户下运行这些命令。
make
...
make install最后node可执行程序安装在/usr/local/bin目录下,npm安装在/usr/local/lib/node_modules目录下
可以运行make test进行测试。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: