gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:04:31 25 4
gpt4 key购买 nike

我尝试按照 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

关于node.js - 无法在 CentOS 7 上安装 node.js v8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46459514/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com