尝试在CentOS上安装nodejs 12时出现错误

kiz8lqtg  于 2022-11-07  发布在  其他
关注(0)|答案(1)|浏览(250)

我正在尝试在我的centos 6机器版本上安装nodejs:12.3.x86_64分位数
我正在运行以下命令:-

curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -
sudo yum install nodejs

我收到以下错误

Loaded plugins: fastestmirror
Setting up Install Process
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

如何化解它。

gmxoilav

gmxoilav1#

NodeJS 12不支持Centos 6。Centos 6使用的glibc和libstdc++版本对于NodeJS来说太低。
您在Centos 6上只能使用版本10。
如果你还想把NodeJS 12塞进Centos 6,那么你可以做下面的事情,但它可能会砖其他东西,做你自己的风险。

wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-utils-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-static-2.17-55.el6.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libstdc++-4.8.5-44.el7.x86_64.rpm
rpm -Uvh --nodeps --force \
glibc-2.17-55.el6.x86_64.rpm \
glibc-common-2.17-55.el6.x86_64.rpm \
glibc-devel-2.17-55.el6.x86_64.rpm \
glibc-headers-2.17-55.el6.x86_64.rpm \
glibc-static-2.17-55.el6.x86_64.rpm \
glibc-utils-2.17-55.el6.x86_64.rpm \
libstdc++-4.8.5-44.el7.x86_64.rpm

而且您不能使用自动安装程序,您必须单独下载NodeJS 12,因为自动安装程序不接受Centos 6。

相关问题