CentOS 7 升级node.js提示Requires:http-parser >= 2.7.0错误

之前在去年安装node.js时,yum install直接就搞定。这次虚拟机太久未登陆,于是登陆’yum update’遇到了如下错误:

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

查了下,是因为CentOS 的EPEL里已经移除了Node.js而放在了REHL中。
因此需要去下载http-parser安装即可.

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