Node.js 4.2.3 just came out, and we want to install or upgrade to this version. But since I’m forced to operate on a CentOS machine I was saddened to see this when attempting to configure:

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

With great regret, I set about figuring out how to install (read: build) newer compiler tools for a distribution that is very slow to change, but lo! I was pleasantly surprised to find out that Scientific Linux had me covered!

All you have to do to get a modern version of G++ is:

sudo curl > /etc/yum.repos.d/slc6-scl.repo
sudo rpm --import
sudo yum install -y devtoolset-3

And to utilize it without having to set environment variables:

scl enable devtoolset-3 bash

You have a shell with access to G++ 4.9 and Node.js is happy. For completeness, here’s what to do to compile it:

tar xvzf node-v4.2.3.tar.gz
cd node-v4.2.3
sudo make install

Original post from: by krisreeves.

About The Author