标签:
如果想在CentOS 6 中安装Node.js >4.0,如果通过以往的方式安装:
wget https://nodejs.org/dist/latest/node-v4.0.0.tar.xz tar zvxf node-v4.0.0.tar.xz cd node-v4.0.0 ./configure make && make install
会遇到报错提示:
WARNING: C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=g++)
提示要更新C++编译器的版本,可以按照以下方式更新:
sudo curl http://linuxsoft.cern.ch/cern/scl/slc6-scl.repo > /etc/yum.repos.d/slc6-scl.repo sudo rpm --import http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern sudo yum install -y devtoolset-3
scl enable devtoolset-3 bash
更新完后,再次./configure 和 make && make install
或者可以按照Node.js官网的推荐安装方式:
curl --silent --location https://rpm.nodesource.com/setup | bash - yum -y install nodejs
拉取成功后再
yum install gcc-c++ make
标签:
原文地址:http://www.cnblogs.com/zzbo/p/4963137.html