[英]how to install nodejs8.x on centos7? i got error
I have to install nodejs8 on centos 7. However, the installation failed.我必须在 centos 7 上安装 nodejs8。但是,安装失败。 I'm attaching the code I excuted and the execution result below, so please help me
我附上我执行的代码和下面的执行结果,所以请帮助我
<> =================================================== <> ================================================= ===
[root@localhost ~]# sudo curl --silent --location https://rpm.nodesource.com/setup_8.x | [root@localhost ~]# sudo curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
须藤 bash -
[root@localhost ~]# sudo yum install gcc-c++ make [root@localhost ~]# sudo yum install gcc-c++ make
[root@localhost ~]# sudo yum install -y nodejs [root@localhost ~]# sudo yum install -y nodejs
Total download size: 32 M Installed size: 92 M Downloading packages: No Presto metadata available for nodesource nodejs-14.18.3-1nodesource.x86 FAILED总下载大小:32 M 安装大小:92 M 下载包:没有可用于 nodesource nodejs-14.18.3-1nodesource.x86 的 Presto 元数据
https://rpm.nodesource.com/pub_8.x/el/7/x86_64/nodejs-14.18.3-1nodesource.x86_64.rpm : [Errno 14] HTTPS Error 404 - Not Found ] 0.0 B/s | https://rpm.nodesource.com/pub_8.x/el/7/x86_64/nodejs-14.18.3-1nodesource.x86_64.rpm :[Errno 14] HTTPS 错误 04/未找到] 0 B --:--:-- `ETA Trying other mirror.
0 B --:--:-- `ETA 正在尝试其他镜像。 Error downloading packages: 2:nodejs-14.18.3-1nodesource.x86_64: [Errno 256] No more mirrors to try.
下载包时出错:2:nodejs-14.18.3-1nodesource.x86_64: [Errno 256] 没有更多镜像可以尝试。 ===================================================+++++++++++++++++++++++++
==================================================== =++++++++++++++++++++++++++++++
Here are two ways to try:这里有两种方法可以尝试:
NOTE - Tested on CentOS 7.9.
注意- 在 CentOS 7.9 上测试。
sudo yum install epel-release
sudo curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum install gcc-c++ make
sudo yum install nodejs
wget https://nodejs.org/dist/latest-v8.x/node-v8.17.0-linux-x64.tar.gz -P ~/Downloads
cd ~/Downloads
sudo tar -C /usr/local --strip-components 1 -xzf node*.tar.gz
Afterwards, check that nodejs was installed:之后,检查是否安装了 nodejs:
$ node -v
v8.17.0
$ npm -v
6.13.4
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.