无法在 CentOS 7 上安装 node.js v8

Unable to install node.js v8 on CentOS 7

我尝试按照 nodesource 上的说明 运行 以 root 身份执行这些命令:

curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
yum install -y nodejs

但是当我 运行 node -v 后来我看到它只安装了 0.10.48。我可以在第二个命令的输出中看到它选择了错误的包下载版本:

Loaded plugins: fastestmirror, priorities
Setting up Install Process
Loading mirror speeds from cached hostfile
 * epel: mirror.steadfast.net
 * remi: repo1.sea.innoscale.net
 * remi-safe: repo1.sea.innoscale.net
2418 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 0:0.10.48-3.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================================
 Package                                    Arch                                       Version                                            Repository                                Size
=========================================================================================================================================================================================
Installing:
 nodejs                                     x86_64                                     0.10.48-3.el6                                      epel                                     2.1 M

Transaction Summary
=========================================================================================================================================================================================
Install       1 Package(s)

Total download size: 2.1 M
Installed size: 7.1 M
Downloading Packages:
nodejs-0.10.48-3.el6.x86_64.rpm                                                                                                                                   | 2.1 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : nodejs-0.10.48-3.el6.x86_64                                                                                                                                           1/1 
  Verifying  : nodejs-0.10.48-3.el6.x86_64                                                                                                                                           1/1 

Installed:
  nodejs.x86_64 0:0.10.48-3.el6                                                                                                                                                          

Complete!

我尝试使用 yum remove -y nodejs npm 卸载,然后 运行 卸载 rm -fv /etc/yum.repos.d/nodesource*yum clean allyum update,然后重新安装,但似乎没有任何效果。

为什么它不解析为 v8 包?

几天前我遇到了同样的问题,我无法通过 nodesource 存储库安装 Node 版本 8。
事实上,rpm 存储库中还没有 setup_8.x 脚本。
我最终得到 n 包来获取 Node 版本 8:

# yum install nodejs  // you need to have npm installed
# npm install -g n
# n stable
# node -v  // v8.4.0