以下包具有未满足的依赖项:nodejs:Conflicts:npm

Modified on: Wed, 21 Aug 2019 19:00:02 +0800

我遵循了这个要点https://gist.github.com/Goddard/5500157安装nodejs和npm,但在运行它之后,既不能运行node --version或npm --version,也会发出命令错误。我能够卸载nodejs,但必须进入脚本中描述的临时目录并执行make uninstall以使npm离开。

现在尝试再次安装nodejs和npm我使用了这个链接http://www.andreagrandi.it/2013/02/08/how-to-install-latest-stable-node-js-on-ubuntu/,但如果我尝试同时安装nodejs和npm,我会收到此错误消息。

sudo apt-get install nodejs npm

The following packages have unmet dependencies:
   nodejs : Conflicts: npm
E: Unable to correct problems, you have held broken packages.

如果我只是安装了工作正常的nodejs。

sudo apt-get install nodejs

node --version
v0.10.15

但是现在如果我尝试安装npm,它会给我这个错误消息

sudo apt-get install npm 

The following packages have unmet dependencies:
npm : Depends: nodejs (>= 0.6.19~dfsg1-3) but it is not going to be installed
   Depends: nodejs-dev
   Depends: node-node-uuid but it is not going to be installed
   Depends: node-request but it is not going to be installed
   Depends: node-mkdirp but it is not going to be installed
   Depends: node-minimatch but it is not going to be installed
   Depends: node-semver but it is not going to be installed
   Depends: node-ini but it is not going to be installed
   Depends: node-graceful-fs but it is not going to be installed
   Depends: node-abbrev but it is not going to be installed
   Depends: node-nopt but it is not going to be installed
   Depends: node-fstream but it is not going to be installed
   Depends: node-rimraf but it is not going to be installed
   Depends: node-tar but it is not going to be installed
   Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我使用的是Ubuntu 13.04。任何帮助表示赞赏。我对node.js和npm了解不多。我试图开始学习如何使用这些,所以我的经验可能正在显示。

最佳答案

从PPA安装的nodejs包包括自v0.10.0以来的npm。由于你有v0.10.15,当你运行sudo apt-get install nodejs时,你还安装了npm。尝试运行npm进行确认。

另请参阅官方安装指南 (你所遵循的是它的副本,但官方的有一些额外的细节)。

作者:cyberx86

相关问答

添加新评论