node安裝配置

1 、解壓

tar zxvf node-v8.9.3.tar.gz && cd node-v8.9.3

2、編譯

 ./configure --prefix=/usr/local/node/8.9.3

WARNING: C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=g++)

creating ./icu_config.gypi

* Using ICU in deps/icu-small

creating ./icu_config.gypi

{ 'target_defaults': { 'cflags': [],

                       'default_configuration': 'Release',

                       'defines': [],

                       'include_dirs': [],

                       'libraries': []},

  'variables': { 'asan': 0,

                 'coverage': 'false',

                 'debug_devtools': 'node',

                 'debug_http2': 'false',

                 'debug_nghttp2': 'false',

                 'force_dynamic_crt': 0,

                 'gas_version': '2.25',

                 'host_arch': 'x64',

                 'icu_data_file': 'icudt59l.dat',

                 'icu_data_in': '../../deps/icu-small/source/data/in/icudt59l.dat',

                 'icu_endianness': 'l',

                 'icu_gyp_path': 'tools/icu/icu-generic.gyp',

                 'icu_locales': 'en,root',

                 'icu_path': 'deps/icu-small',

                 'icu_small': 'true',

                 'icu_ver_major': '59',

                 'node_byteorder': 'little',

                 'node_enable_d8': 'false',

                 'node_enable_v8_vtunejit': 'false',

                 'node_install_npm': 'true',

                 'node_module_version': 57,

                 'node_no_browser_globals': 'false',

                 'node_prefix': '/usr/local/node/8.9.3',

                 'node_release_urlbase': '',

                 'node_shared': 'false',

                 'node_shared_cares': 'false',

                 'node_shared_http_parser': 'false',

                 'node_shared_libuv': 'false',

                 'node_shared_openssl': 'false',

                 'node_shared_zlib': 'false',

                 'node_tag': '',

                 'node_use_bundled_v8': 'true',

                 'node_use_dtrace': 'false',

                 'node_use_etw': 'false',

                 'node_use_lttng': 'false',

                 'node_use_openssl': 'true',

                 'node_use_perfctr': 'false',

                 'node_use_v8_platform': 'true',

                 'node_without_node_options': 'false',

                 'openssl_fips': '',

                 'openssl_no_asm': 0,

                 'shlib_suffix': 'so.57',

                 'target_arch': 'x64',

                 'uv_parent_path': '/deps/uv/',

                 'uv_use_dtrace': 'false',

                 'v8_enable_gdbjit': 0,

                 'v8_enable_i18n_support': 1,

                 'v8_enable_inspector': 1,

                 'v8_no_strict_aliasing': 1,

                 'v8_optimized_debug': 0,

                 'v8_promise_internal_field_count': 1,

                 'v8_random_seed': 0,

                 'v8_trace_maps': 0,

                 'v8_use_snapshot': 'true',

                 'want_separate_host_toolset': 0}}

creating ./config.gypi

creating ./config.mk

WARNING: warnings were emitted in the configure phase

3、make

4、make install

5、設置環境變量, /etc/profile

#set for nodejs

export NODE_HOME=/usr/local/node/8.9.3

export NODE_ENV=production

export PATH=$NODE_HOME/bin:$PATH

6、安裝pm2 

npm install -g pm2


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章