我的构建脚本以下列方式在CentOS上安装NPM:
yum -y update
yum install -y wget
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
yum --enablerepo=epel -y groupinstall "Development Tools"
yum --enablerepo=epel -y install npm
在上周的某个时刻,我遇到了以下依赖问题:
Error: Package: nodejs-npm-registry-client-0.2.28-1.el6.noarch (epel)
Requires: npm(semver) >= 2.1.0
Installing: nodejs-semver-2.0.10-1.el6.noarch (epel)
npm(semver) = 2.0.10
Error: Package: nodejs-request-2.21.0-1.el6.noarch (epel)
Requires: npm(form-data) < 0.1
Available: nodejs-form-data-0.1.1-1.el6.noarch (epel)
npm(form-data) = 0.1.1
Error: Package: nodejs-request-2.21.0-1.el6.noarch (epel)
Requires: npm(form-data) < 0.1
Installing: nodejs-form-data-0.1.1-1.el6.noarch (epel)
npm(form-data) = 0.1.1
Error: Package: nodejs-npm-registry-client-0.2.28-1.el6.noarch (epel)
Requires: npm(request) >= 2.25.0
Installing: nodejs-request-2.21.0-1.el6.noarch (epel)
npm(request) = 2.21.0
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
我已经能够从源代码安装NPM,但是我更喜欢使用yum软件包。谁能为我提供一些指示?谢谢!
答案 0 :(得分:2)
我们使用epel-testing repo来安装npm并绕过epel repo的问题
yum --enablerepo=epel-testing install npm
更新:这对于epel repo来说是固定的
yum install npm
答案 1 :(得分:0)
使用干净的CentOS 6.5安装,我只需要在这里获取最新的epel存储库:
http://mirrors.servercentral.net/fedora/epel/6/i386/repoview/epel-release.html
您可以使用wget或GUI浏览器来获取该页面上链接的包:
http://mirrors.servercentral.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
运行rpm install,默认情况下将启用epel,并且可以使用标准yum install命令安装npm依赖项:
yum install npm