Cenots 7 通过Yum 安装Node.js 报错问题

环境:
CentOS Linux release 7.3.1611 (Core) 

安装报错信息:

[cenots7@localhost ~]$ sudo yum -y install npm
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * remi-safe: mirror.innosol.asia
Resolving Dependencies
--> Running transaction check
---> Package npm.x86_64 1:3.10.10-1.6.11.1.1.el7 will be installed
--> Processing Dependency: nodejs = 1:6.11.1-1.el7 for package: 1:npm-3.10.10-1.6.11.1.1.el7.x86_64
--> Running transaction check
---> Package nodejs.x86_64 1:6.11.1-1.el7 will be installed
--> Processing Dependency: libuv >= 1:1.9.1 for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: http-parser >= 2.7.0 for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libuv.so.1()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libicuuc.so.50()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libicui18n.so.50()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libicudata.so.50()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libhttp_parser.so.2()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Running transaction check
---> Package libicu.x86_64 0:50.1.2-15.el7 will be installed
---> Package libuv.x86_64 1:1.10.2-1.el7 will be installed
---> Package nodejs.x86_64 1:6.11.1-1.el7 will be installed
--> Processing Dependency: http-parser >= 2.7.0 for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Processing Dependency: libhttp_parser.so.2()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Finished Dependency Resolution
Error: Package: 1:nodejs-6.11.1-1.el7.x86_64 (epel)
           Requires: libhttp_parser.so.2()(64bit)
Error: Package: 1:nodejs-6.11.1-1.el7.x86_64 (epel)
           Requires: http-parser >= 2.7.0
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

解决方法:

需要安装:http-parser 插件

[centos@localhost ~]$ sudo wget https://kojipkgs.fedoraproject.org//packages/http-parser/2.7.1/3.el7/x86_64/http-parser-2.7.1-3.el7.x86_64.rpm
[centos@localhost ~]$ sudo wget https://kojipkgs.fedoraproject.org//packages/http-parser/2.7.1/3.el7/x86_64/http-parser-devel-2.7.1-3.el7.x86_64.rpm
[centos@localhost ~]$ sudo yum -y localinstall http-parser-*
[centos@localhost ~]$ sudo yum -y install nodejs npm nodejs-devel
[centos@localhost ~]$ sudo rm -rf http-parser-*

 

转载于:https://www.cnblogs.com/itusye/p/7404626.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值