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 :3.10.-1.6.11.1..el7 will be installed
--> Processing Dependency: nodejs = :6.11.-.el7 for package: :npm-3.10.-1.6.11.1..el7.x86_64
--> Running transaction check
---> Package nodejs.x86_64 :6.11.-.el7 will be installed
--> Processing Dependency: libuv >= :1.9. for package: :nodejs-6.11.-.el7.x86_64
--> Processing Dependency: http-parser >= 2.7. for package: :nodejs-6.11.-.el7.x86_64
--> Processing Dependency: libuv.so.()(64bit) for package: :nodejs-6.11.-.el7.x86_64
--> Processing Dependency: libicuuc.so.()(64bit) for package: :nodejs-6.11.-.el7.x86_64
--> Processing Dependency: libicui18n.so.()(64bit) for package: :nodejs-6.11.-.el7.x86_64
--> Processing Dependency: libicudata.so.()(64bit) for package: :nodejs-6.11.-.el7.x86_64
--> Processing Dependency: libhttp_parser.so.()(64bit) for package: :nodejs-6.11.-.el7.x86_64
--> Running transaction check
---> Package libicu.x86_64 :50.1.-.el7 will be installed
---> Package libuv.x86_64 :1.10.-.el7 will be installed
---> Package nodejs.x86_64 :6.11.-.el7 will be installed
--> Processing Dependency: http-parser >= 2.7. for package: :nodejs-6.11.-.el7.x86_64
--> Processing Dependency: libhttp_parser.so.()(64bit) for package: :nodejs-6.11.-.el7.x86_64
--> Finished Dependency Resolution
Error: Package: :nodejs-6.11.-.el7.x86_64 (epel)
Requires: libhttp_parser.so.()(64bit)
Error: Package: :nodejs-6.11.-.el7.x86_64 (epel)
Requires: http-parser >= 2.7.
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-*
上一篇:利用yum安装时,报错 [Errno 256] No more mirrors to try.


下一篇:yum安装zabbix故障报错