Today, my company's development colleagues asked me to install node on the server for testing. At first, I wanted to use docker for it. However, many problems on the docker node were not solved due to temporary flexibility, I had to compile and install a node for him. I didn't expect a problem in the first step of compilation. I told him that the gcc version on my server was low and I had to upgrade gcc.
System: centos 6.5 (64-bit)
1. Download The yum source file
Gcc -- version
Wget http://people.centos.org/tru/devtools-2/devtools-2.repo-O/etc/yum. repos. d/devtools-2.repo
2. Install the latest development tools
Yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c ++
3. View the newly installed gcc version.
/Opt/rh/devtoolset-2/root/usr/bin/gcc -- version
4. Replace local gcc
Ln-s/opt/rh/devtoolset-2/root/usr/bin/*/usr/local/bin/
Hash-r
Gcc -- version
We can see that gcc has been upgraded to 4.8.2. Now, you can compile and install the node.