我遵循了下面的链接中所示的说明,但我无法在NodeJS上安装v10。
curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash -
yum install nodejs我受到以下信息的欢迎:
## Installing the NodeSource Node.js 10.x repo...
## Inspecting system...
+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
+ uname -m
## Confirming "el7-x86_64" is supported...
+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'
## Downloading release setup RPM...
+ mktemp
+ curl -sL -o '/tmp/tmp.p7C7NIfygt' 'https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'
## Installing release setup RPM...
+ rpm -i --nosignature --force '/tmp/tmp.p7C7NIfygt'
warning: /etc/yum.repos.d/nodesource-el7.repo created as /etc/yum.repos.d/nodesource-el7.repo.rpmnew
## Cleaning up...
+ rm -f '/tmp/tmp.p7C7NIfygt'
## Checking for existing installations...
+ rpm -qa 'node|npm' | grep -v nodesource
## Run `sudo yum install -y nodejs` to install Node.js 10.x and npm.
## You may also need development tools to build native addons:
sudo yum install gcc-c++ make
## To install the Yarn package manager, run:
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo yum install yarn
Package matching 1:nodejs-6.16.0-1.el7.x86_64 already installed. Checking for update.
Nothing to doyum --showduplicates list nodejs |expand显示:
Installed Packages
nodejs.x86_64 2:9.6.0-1nodesource @nodesource
Available Packages
nodejs.x86_64 1:6.12.2-1.el7 localepel
nodejs.x86_64 1:6.12.3-1.el7 localepel
nodejs.x86_64 1:6.14.0-1.el7 localepel
nodejs.x86_64 1:6.14.2-1.el7 localepel
nodejs.x86_64 1:6.14.3-1.el7 localepel
nodejs.x86_64 1:6.16.0-1.el7 localepel node -v显示:
v9.6.0
不管我做什么,我似乎都无法安装v10。
资料来源:
发布于 2019-03-07 13:18:38
我看到的问题是,这个系统以前从nodesource安装了NodeJS9.x,在尝试安装nodejs 10之前,无论是nodesource安装脚本还是系统管理员都没有删除它及其回购。
更糟糕的是,脚本实际上忽略了这个问题,并试图继续前进,尽管它不可能工作。(这个问题应该报告给维护人员。)
要解决这个问题,首先删除提供NodeJS9.x的yum,然后再次运行NodeJS10.x的安装脚本。
yum remove $(rpm -qf /etc/yum.repos.d/nodesource.repo)这应该足够清理系统,以便尝试安装NodeJS10.x将成功。
发布于 2019-07-03 15:55:47
NodeJs 10在RHEL7中本机不受支持(RHEL8中支持它)。您可以尝试手动安装CentOS 7版本。
发布于 2019-10-06 09:14:51
删除提供node.js v9.x或以前版本的yum之后,需要运行以下命令来清除yum缓存:
苏多芬洗净一切&苏多芬使疼痛迅速。
然后最后:
sudo安装-y nodejs
https://serverfault.com/questions/957126
复制相似问题