对 CentOS 6.4 的依赖中断:可以安装 nodejs 但不能安装 npm

Phi*_*ßen 2 centos yum node.js epel centos6.4

我正在使用带有 EPEL 存储库的全新安装的 CentOS 6.4 (x86-64)。

$ yum install nodejs
...
$ node -v
v0.10.5
Run Code Online (Sandbox Code Playgroud)

到目前为止,npm一切都很好,但是当我尝试安装时,我会收到以下错误消息:

$ yum install npm
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: ftp.halifax.rwth-aachen.de
 * epel: mirror.fraunhofer.de
 * extras: centos.psw.net
 * updates: centos.psw.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package npm.noarch 0:1.2.17-5.el6 will be installed
--> Processing Dependency: npm(which) < 2 for package: npm-1.2.17-5.el6.noarch
--> Processing Dependency: npm(uid-number) < 1 for package: npm-1.2.17-5.el6.noarch
--> Processing Dependency: npm(tar) < 0.2 for package: npm-1.2.17-5.el6.noarch
--> Processing Dependency: npm(slide) < 2 for package: npm-1.2.17-5.el6.noarch
--> Processing Dependency: npm(semver) < 1.2 for package: npm-1.2.17-5.el6.noarch
...
(skipped)
...
--> Finished Dependency Resolution
Error: Package: nodejs-npmlog-0.0.2-4.el6.noarch (epel)
           Requires: npm(ansi) < 0.2
Error: Package: npm-1.2.17-5.el6.noarch (epel)
           Requires: npm(ansi) < 0.2
Error: Package: nodejs-npmlog-0.0.2-4.el6.noarch (epel)
           Requires: npm(ansi) >= 0.1.2
Error: Package: npm-1.2.17-5.el6.noarch (epel)
           Requires: npm(ansi) >= 0.1.2
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
Run Code Online (Sandbox Code Playgroud)

完整的输出相当大:http : //pastebin.com/raw.php?i=Ce3ZJsEB

我该怎么办?该--skip-broken解决方法似乎并没有被正确的解决方案。

这是输出yum repolist

Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
 * base: centos.copahost.com
 * epel: mirror.fraunhofer.de
 * extras: ftp-stud.fht-esslingen.de
 * updates: centos.copahost.com
 repo id       repo name                                            status
 base          CentOS-6 - Base                                      6,381
 epel          Extra Packages for Enterprise Linux 6 - x86_64       8,909
 extras        CentOS-6 - Extras                                       12
 updates       CentOS-6 - Updates                                     727
 repolist: 16,029
Run Code Online (Sandbox Code Playgroud)

scx*_*scx 5

包装的NodeJS-ANSI从EPEL(的NodeJS-ANSI-0.1.2-7.el6.noarch)被打破。

尝试:

wget http://kojipkgs.fedoraproject.org//packages/nodejs-ansi/0.1.2/7.el6.1/noarch/nodejs-ansi-0.1.2-7.el6.1.noarch.rpm
yum --enablerepo="epel" install npm ./nodejs-ansi-0.1.2-7.el6.1.noarch.rpm
Run Code Online (Sandbox Code Playgroud)

解决方案基于 irc.freenode.net 上的 #epel。

另请参阅:http : //pastebin.com/mqFqRqUp 第 28 行