歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 編譯安裝Node.js

Ubuntu 編譯安裝Node.js

日期:2017/2/28 14:42:59   编辑:Linux教程

Ubuntu 編譯安裝Node.js

到node.js網站下載最新壓縮包,然後解壓到/opt目錄下。

Node.js 的詳細介紹:請點這裡
Node.js 的下載地址:請點這裡

安裝GCC後,運行./configure

root@html5viewer1:/opt/node-v0.10.20# ./configure
{ '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進行測試。

Copyright © Linux教程網 All Rights Reserved