centos 下按转 node

Centos 下安装node

踩过好多坑,下面的靠谱

1、根据如下图及官网查看 wget的url,比如 https://nodejs.org/dist/v9.3.0/node-v9.3.0-linux-x64.tar.gz 

2、解压文件

(一)编译好的文件

1
2
3
4
5
tar  xf node - v5. 10.1 - linux - x64.tar.gz  - / usr / local /
cd  / usr / local /
mv node - v5. 10.1 - linux - x64 /  nodejs
ln  - / usr / local / nodejs / bin / node  / usr / local / bin
ln  - / usr / local / nodejs / bin / npm  / usr / local / bin

(二)通过源码编译

    这种方式你下载的文件是Source code,由于我的linux版本是6.x的,默认的gcc-c++为4.4.7 版本,而下过来之后源码编译要求gcc-c++版本最低为4.8,于是我就去升级GCC-C++版本,结果因为是源码编译升级GCC-C++,编译了一个多小时,都没有编译完成!果断被坑...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
root> # ./configure
WARNING: C + +  compiler too old, need g + +  4.8  or  clang + +  3.4  (CXX = g + + )
creating  . / icu_config.gypi
'target_defaults' : {  'cflags' : [],
                        'default_configuration' 'Release' ,
                        'defines' : [],
                        'include_dirs' : [],
                        'libraries' : []},
   'variables' : {  'asan' 0 ,
                  'gas_version' '2.20' ,
                  'host_arch' 'x64' ,
                  'icu_small' 'false' ,
                  'node_byteorder' 'little' ,
                  'node_install_npm' 'true' ,
                  'node_prefix' '/usr/local' ,
                  'node_release_urlbase' : '',
                  'node_shared_http_parser' 'false' ,
                  'node_shared_libuv' 'false' ,
                  'node_shared_openssl' 'false' ,
                  'node_shared_zlib' 'false' ,
                  'node_tag' : '',
                  'node_use_dtrace' 'false' ,
                  'node_use_etw' 'false' ,
                  'node_use_lttng' 'false' ,
                  'node_use_openssl' 'true' ,
                  'node_use_perfctr' 'false' ,
                  'openssl_fips' : '',
                  'openssl_no_asm' 0 ,
                  'target_arch' 'x64' ,
                  'uv_parent_path' '/deps/uv/' ,
                  'uv_use_dtrace' 'false' ,
                  'v8_enable_gdbjit' 0 ,
                  'v8_enable_i18n_support' 0 ,
                  'v8_no_strict_aliasing' 1 ,
                  'v8_optimized_debug' 0 ,
                  'v8_random_seed' 0 ,
                  'v8_use_snapshot' 'true' ,
                  'want_separate_host_toolset' 0 }}
creating  . / config.gypi
creating  . / config.mk
WARNING: warnings were emitted  in  the configure phase


以上请参考,详情转摘至 http://www.cnblogs.com/kevinchou/p/5405540.html ;



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值