curl -sL https://rpm.nodesource.com/setup_14.x | bash -
yum install -y nodejs
node -v
npm -v
[root@VM-0-5-centos ~]# yum install -y nodejs
已加载插件:fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* centos-sclo-rh: mirror.xtom.com.hk
centos-sclo-rh | 3.0 kB 00:00
epel | 4.7 kB 00:00
extras | 2.9 kB 00:00
nodesource | 2.5 kB 00:00
os | 3.6 kB 00:00
updates | 2.9 kB 00:00
(1/4): centos-sclo-rh/x86_64/primary_db | 3.4 MB 00:00
(2/4): epel/7/x86_64/updateinfo | 1.0 MB 00:00
(3/4): nodesource/x86_64/primary_db | 62 kB 00:00
(4/4): epel/7/x86_64/primary_db | 7.0 MB 00:00
正在解决依赖关系
--> 正在检查事务
---> 软件包 nodejs.x86_64.2.14.21.1-1nodesource 将被 安装
--> 解决依赖关系完成
依赖关系解决
================================================================================
Package 架构 版本 源 大小
================================================================================
正在安装:
nodejs x86_64 2:14.21.1-1nodesource nodesource 33 M
事务概要
================================================================================
安装 1 软件包
总下载量:33 M
安装大小:95 M
Downloading packages:
警告:/var/cache/yum/x86_64/7/nodesource/packages/nodejs-14.21.1-1nodesource.x86_64.rpm: 头V4 RSA/SHA512 Signature, 密钥 ID 34fa74dd: NOKEY
nodejs-14.21.1-1nodesource.x86_64.rpm 的公钥尚未安装
nodejs-14.21.1-1nodesource.x86_64.rpm | 33 MB 00:02
从 file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL 检索密钥
导入 GPG key 0x34FA74DD:
用户ID : "NodeSource <gpg-rpm@nodesource.com>"
指纹 : 2e55 207a 95d9 944b 0cc9 3261 5ddb e8d4 34fa 74dd
软件包 : nodesource-release-el7-1.noarch (installed)
来自 : /etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
正在安装 : 2:nodejs-14.21.1-1nodesource.x86_64 1/1
验证中 : 2:nodejs-14.21.1-1nodesource.x86_64 1/1
已安装:
nodejs.x86_64 2:14.21.1-1nodesource
完毕!
[root@VM-0-5-centos ~]#
[root@VM-0-5-centos ~]# node -v
v14.21.1
[root@VM-0-5-centos ~]# npm -v
6.14.17
测试 ok
npm install cnpm -g --registry=https://registry.npm.taobao.org
评论(0)