Ubuntu 编译安装node.js

来源:互联网 发布:linux 开启vnc服务 编辑:程序博客网 时间:2024/06/05 07:02

到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.gypicreating  ./config.mkroot@html5viewer1:/opt/

然后开始编译,成功后安装,我都是在root用户下运行这些命令。

make...make install
最后node可执行程序安装在/usr/local/bin目录下,npm安装在/usr/local/lib/node_modules目录下

可以运行make test进行测试。



原创粉丝点击