问题: centos7服务器使用nvm或n安装的16以后的高版本node,均会出现以下问题
解决
1.升级gcc与make
-
# 升级GCC(默认为4 升级为8)
-
yum install -y centos-release-scl bison
-
yum install -y devtoolset-8-gcc*
-
ln -s /opt/rh/devtoolset-8/root/bin/gcc /usr/bin/gcc
-
ln -s /opt/rh/devtoolset-8/root/bin/g++ /usr/bin/g++
-
# 升级 make(默认为3 升级为4)
-
wget http://ftp.gnu.org/gnu/make/make-4.3.tar.gz
-
tar -xzvf make-4.3.tar.gz && cd make-4.3/
-
./configure --prefix=/usr/local/make
-
make && make install
-
cd /usr/bin/ && mv make make.bak
-
ln -sv /usr/local/make/bin/make /usr/bin/make
上一步yum install -y devtoolset-8-gcc*报错请参考,没有则忽略
Centos7 停止维护之后 升级gcc||找不到devtoolset-8-gcc* 问题解决方案 - Jedi_Pz - 博客园
2.更新libstdc++.so.6.0.26
-
# 更新lib libstdc++.so.6.0.26
-
wget https://cdn.frostbelt.cn/software/libstdc%2B%2B.so.6.0.26
-
# 替换系统中的/usr/lib64
-
cp libstdc++.so.6.0.26 /usr/lib64/
-
cd /usr/lib64/
-
ln -snf ./libstdc++.so.6.0.26 libstdc++.so.6
3.更新glibc
-
wget http://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz
-
tar xf glibc-2.28.tar.gz
-
cd glibc-2.28/ && mkdir build && cd build
-
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
-
make && make install
4.验证
-
npm -v
-
node -v
本文来自博客园,作者:六月OvO,转载请注明原文链接:node: /lib64/libm.so.6: version `GLIBC_2.27‘ not found问题解决方案 - 六月OvO - 博客园