【问题标题】:Error while installing npm安装 npm 时出错
【发布时间】:2017-06-13 13:25:54
【问题描述】:

以下包具有未满足的依赖关系: npm :取决于:nodejs,但不会安装

   Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
   Depends: node-ansi but it is not going to be installed
   Depends: node-archy but it is not going to be installed
   Depends: node-block-stream but it is not going to be installed
   Depends: node-fstream (>= 0.1.22) but it is not going to be installed
   Depends: node-fstream-ignore but it is not going to be installed
   Depends: node-github-url-from-git but it is not going to be installed
   Depends: node-glob (>= 3.1.21) but it is not going to be installed
   Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed
   Depends: node-inherits but it is not going to be installed
   Depends: node-ini (>= 1.1.0) but it is not going to be installed
   Depends: node-lockfile but it is not going to be installed
   Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed
   Depends: node-minimatch (>= 0.2.11) but it is not going to be installed
   Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed
   Depends: node-gyp (>= 0.10.9) but it is not going to be installed
   Depends: node-nopt (>= 2.1.1) but it is not going to be installed
   Depends: node-npmlog but it is not going to be installed
   Depends: node-once but it is not going to be installed
   Depends: node-osenv but it is not going to be installed
   Depends: node-read but it is not going to be installed
   Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed
   Depends: node-request (>= 2.25.0) but it is not going to be installed
   Depends: node-retry but it is not going to be installed
   Depends: node-rimraf (>= 2.2.2) but it is not going to be installed
   Depends: node-semver (>= 2.1.0) but it is not going to be installed
   Depends: node-sha but it is not going to be installed
   Depends: node-slide but it is not going to be installed
   Depends: node-tar (>= 0.1.18) but it is not going to be installed
   Depends: node-which but it is not going to be installed

E: 无法纠正问题,您持有损坏的包裹。

我已尝试 sudo apt-get install -f 但仍然遇到同样的错误。 请帮忙

【问题讨论】:

  • sudo apt-get install npm

标签: node.js npm


【解决方案1】:

当你安装 nodejs 时你会得到 npm。所以尝试以下方法:

$ sudo apt-get install nodejs

来源:https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

请注意,您不能在没有节点的情况下安装 npm,因为 npm 严重依赖它。有关详细信息,请参阅 github 上的 thread

【讨论】:

  • 我已经安装了nodejs。之后我尝试安装 npm 并收到错误。
  • 很可能,您已经安装了 npm。尝试在您的终端中执行 npm -v 并告诉我您得到了什么?
  • npm -v 给出结果 3.8.6
  • 好的。谢谢。实际上,我正在努力安装 appium 并按照步骤操作。这些步骤告诉我安装 npm。您对如何安装appium有任何想法。我试过 npm install -g appium 但得到错误:- 错误:make failed with exit code: 2
  • 我认为您应该为此提出一个单独的问题并在其中显示完整的错误。
猜你喜欢
  • 2016-06-22
  • 2015-10-01
  • 2015-03-21
  • 2016-09-06
  • 2011-11-22
  • 2016-07-18
  • 1970-01-01
相关资源
最近更新 更多