百度到由于node4.0版本后升级了v8引擎,编译时需要gcc4.8以上版本,Centos6自带的gcc为gcc-4.4.7, 不支持编译所需的C++11标准,所以只好升级gcc
安装源
yum install centos-release-scl-rh centos-release-scl
yum check-update
安装devtoolset
yum install devtoolset-6-gcc-c++
当前shell启用devtoolset-6-gcc-c++,如想默认启用,将此行加入到/etc/profile
内即可
source /opt/rh/devtoolset-6/enable
此时再执行install即可