Due to compilation nodejs 5.1 need 4.7 Above gcc, and CentOS Self contained gcc Version only 4.3, Therefore, you need to manually compile and install . By default, all operations are performed by root User execution .

1. Download the source code
# wget ftp://mirrors.kernel.org/gnu/gcc/gcc-4.9.0/gcc-4.9.0.tar.gz
2. decompression , Download dependency package
# tar -zxvf gcc-4.9.0.tar.gz # cd gcc-4.9.0 # ./contrib/download_prerequisites
3. Compile and install
# ./configure --enable-checking=release --enable-languages=c,c++
--disable-multilib # make -j4 # make install
make -j4 About to last 20 Multiple minutes .-j4 It's multi-threaded optimization ,CPU 8 Thread is OK -j8.

4. View version

( After that, I seem to restart the system to take effect )
# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local
/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target:
x86_64-unknown-linux-gnu Configuredwith: ./configure --enable-checking=release
--enable-languages=c,c++ --disable-multilib Thread model: posix gcc version 4.9
.0 (GCC)

Technology