npm : 取决于: node-gyp (>= 0.10.9) 但它不会被安装

Mat*_*Eze 104 package-management apt dependencies npm software-installation

我想安装 npm。我已经更新了所有内容,但无法解决问题。

我得到的消息是:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

你可以帮帮我吗?

小智 243

我能够通过执行以下操作来安装 npm:

sudo apt-get install nodejs-dev node-gyp libssl1.0-dev
Run Code Online (Sandbox Code Playgroud)

sudo apt-get install npm
Run Code Online (Sandbox Code Playgroud)

  • 对于应用此解决方案的任何人:请确保在应用更改之前查看更改,因为它可能会删除一些已安装的包以解决依赖关系。就我而言,在此过程中删除了 Jasp 和更多软件包。 (9认同)
  • Ubuntu 18.04:以下软件包将被删除:libcurl4-openssl-dev libssl-dev (8认同)
  • 这就是修复它,你摇滚 (7认同)
  • 有效,但它卸载了许多已安装的软件包,例如整个 ros-melodic。 (6认同)
  • 在 ubuntu 18.04 上有问题,其中安装了 nodejs 但没有安装 npm,这解决了我的问题 (3认同)
  • 正如@SagunManSinghShrestha 所提到的,它破坏了 ROS 和 Ignition 的安装。在按 Y 之前阅读要删除的包的长列表。 (2认同)