Centos 7 上 Nodejs 安装问题

  • 内容
  • 评论
  • 相关

之前安装 nodejs,都是直接yum install epel-release; yum install nodejs;就可以直接成功安装了,但是这次 Centos 7 的版本似乎对这玩意儿的兼容性不太好。

Problem

[root@nodejs ~]# yum install nodejs
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package nodejs.x86_64 1:6.11.1-1.el7 will be installed
--> Processing Dependency: npm = 1:3.10.10-1.6.11.1.1.el7 for package: 1:nodejs-6.11.1-1.el7.x86_64
--> 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: libhttp_parser.so.2()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64
--> Running transaction check
---> 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
---> Package npm.x86_64 1:3.10.10-1.6.11.1.1.el7 will be installed
--> 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
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit) 

Solution 解答

rpm -ivh https://kojipkgs.fedoraproject.org//packages/http-parser/2.7.1/3.el7/x86_64/http-parser-2.7.1-3.el7.x86_64.rpm && yum -y install nodejs

0013669: can’t install nodejs on centos7

CentOS 7 版本

[root@nodejs ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core) 

评论

0条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注