Nodejs:CentOS 7.5安装Nodejs14

稍微有些慢,但是最终成功了

[vcontroller@vcontroller mongo_place]$ sudo curl --silent --location https://rpm.nodesource.com/setup_14.x | sudo bash -
[sudo] vcontroller 的密码:

## Installing the NodeSource Node.js 14.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_14.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.hppZ0qYQMo' 'https://rpm.nodesource.com/pub_14.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.hppZ0qYQMo'

## Cleaning up...

+ rm -f '/tmp/tmp.hppZ0qYQMo'

## Checking for existing installations...

+ rpm -qa 'node|npm' | grep -v nodesource

## Run `sudo yum install -y nodejs` to install Node.js 14.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
[vcontroller@vcontroller ~]$ sudo yum install -y nodejs
[sudo] vcontroller 的密码:
对不起,请重试。
[sudo] vcontroller 的密码:
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.huaweicloud.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
https://rpm.nodesource.com/pub_14.x/el/7/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://rpm.nodesource.com/pub_14.x/el/7/x86_64/repodata/repomd.xml: (28, 'Operation timed out after 30001 milliseconds with 0 out of 0 bytes received')
正在尝试其它镜像。
https://rpm.nodesource.com/pub_14.x/el/7/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://rpm.nodesource.com/pub_14.x/el/7/x86_64/repodata/repomd.xml: (28, 'Operation timed out after 30000 milliseconds with 0 out of 0 bytes received')
正在尝试其它镜像。
https://rpm.nodesource.com/pub_14.x/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to rpm.nodesource.com:443; 操作现在正在进行"
正在尝试其它镜像。
https://rpm.nodesource.com/pub_14.x/el/7/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to rpm.nodesource.com:443; 操作现在正在进行"
正在尝试其它镜像。
nodesource                                                                                                                                                              | 2.5 kB  00:00:00     
nodesource/x86_64/primary_db                                                                                                                                            |  14 kB  00:00:23     
正在解决依赖关系
--> 正在检查事务
---> 软件包 nodejs.x86_64.2.14.6.0-1nodesource 将被 安装
--> 解决依赖关系完成

依赖关系解决

===============================================================================================================================================================================================
 Package                                  架构                                     版本                                                     源                                            大小
===============================================================================================================================================================================================
正在安装:
 nodejs                                   x86_64                                   2:14.6.0-1nodesource                                     nodesource                                    32 M

事务概要
===============================================================================================================================================================================================
安装  1 软件包

总下载量:32 M
安装大小:92 M
Downloading packages:
警告:/var/cache/yum/x86_64/7/nodesource/packages/nodejs-14.6.0-1nodesource.x86_64.rpm: 头V4 RSA/SHA512 Signature, 密钥 ID 34fa74dd: NOKEY=================  ] 1.7 MB/s |  31 MB  00:00:00 ETA 
nodejs-14.6.0-1nodesource.x86_64.rpm 的公钥尚未安装
nodejs-14.6.0-1nodesource.x86_64.rpm                                                                                                                                    |  32 MB  00:00:41     
从 file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL 检索密钥
导入 GPG key 0x34FA74DD:
 用户ID     : "NodeSource <[email protected]>"
 指纹       : 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.6.0-1nodesource.x86_64                                                                                                                                         1/1 
  验证中      : 2:nodejs-14.6.0-1nodesource.x86_64                                                                                                                                         1/1 

已安装:
  nodejs.x86_64 2:14.6.0-1nodesource                                                                                                                                                           

完毕!
[vcontroller@vcontroller ~]$ node
Welcome to Node.js v14.6.0.
Type ".help" for more information.
> .exit
[vcontroller@vcontroller ~]$ node -v
v14.6.0
[vcontroller@vcontroller ~]$ npm -v
6.14.6

猜你喜欢

转载自blog.csdn.net/shunzi2016/article/details/107640110