大苹果
【NodeJS】GLIBC_2.28 not found CentOS7不兼容Node高版本
提前部署安装编译环境devtoolset-8编译安装glibc-2.28编译安装gcc高版本并配置LD_LIBRARY_PATH参考链接:https://github.com/nodejs/build/issues/2815https://cloud.tencent.com/developer/article/2021784操作步骤1、安装编译环境devtoolset-8sudoyuminstallcentos-release-sclsudoyuminstalldevtoolset-8sclenabledevtoolset-8bashgcc--version2、编译安装glibc-2.28wgethttps://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz--no-check-certificatetar-xzvfglibc-2.28.tar.gzcdglibc-2.28mkdirbuild&&cdbuild../configure--prefix=/usr--disable-profile--enable-add-ons--with-headers=/usr/include--with-binutils=/usr/bin--enable-obsolete-nslconfigure增加--enable-obsolete-nsl,解决编译错误undefinedreferenceto'_nsl_default_nss@GLIBC_PRIVATE'。修改scripts/test-installation.pl128行,增加&&$namene"nss_test2",解决编译错误nss_test2报错。sed-i'128i\&&$namene"nss_test2"'../scripts/test-installation.pl126if($namene"nss_ldap"&&$namene"db1"127&&$namene"thread_db"128&&$namene"nss_test2"129&&$namene"nss_test1"&&$namene"libgcc_s"){130$link_libs.="-l$name";131$versions{$name}=$version;132}执行编译安装:make-j4makeinstall查看glibc支持的版本:strings/lib64/libc.so.6|grepGLIBC3、编译安装gcc高版本并配置LD_LIBRARY_PATHsudoyuminstallgmp-develmpfr-devellibmpc-develwgethttps://ftp.gnu.org/gnu/gcc/gcc-8.5.0/gcc-8.5.0.tar.gz--no-check-certificatetar-xvfgcc-8.5.0.tar.gzcdgcc-8.5.0mkdirbuildcdbuild../configure--disable-multilib--enable-languages=c,c++--prefix=$HOME/localmake-j8makeinstall在~/.bashrc中增加语句:exportLD_LIBRARY_PATH=$HOME/local/lib64
yum,nodejs,Linux,centos
1947
10月前