centos 에서 nodejs 4.x 버젼 설치하기

2015. 12. 17. 10:52Languages/nodejs

centos 에서 nodejs 4.x 버젼 설치하기


centos6.6에서 nodejs를 기본 yum으로  설치할 경우 0.10.x 버젼으로 설치가 된다


글을 작성하는 시점 기준에는 stable 한 버젼은 4.x 대로 차이가 발생하기 때문에 소스 컴파일을 이용해서 설치하려고 했다.


하지만

C++ compiler too old, need g++ 4.8 or clang++ 3.4

와 같은 오류를 뿜으며 설치가 되지 않는다.

centos에 기본으로 내장된 컴파일러가 버젼이 오래되서 발생하는 현상이라고 한다




아래와 같이 빌드툴을 추가 해주고


curl http://linuxsoft.cern.ch/cern/scl/slc6-scl.repo > /etc/yum.repos.d/slc6-scl.repo

rpm --import http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern

yum install -y devtoolset-3


활성화 시켜준 이후


scl enable devtoolset-3 bash 



다시 빌드를 해주면 된다

./configure

make

make install



참고:

http://stackoverflow.com/questions/32561962/install-nodejs-4-on-redhat