【发布时间】:2026-02-09 23:00:01
【问题描述】:
作为我need an updated version of NodeJS,我先删除旧版本... 作者:
apt-get remove --purge nodejs
apt-get remove --purge node
apt-get autoremove
...after sucess on install last version of NodeJS,我运行了 npm 安装程序,
node --version # now is ok!
sudo apt-get install npm # ERROR!!!!
那么,如何在这种情况下安装 npm(在此清除过程之后)
编辑:
PS:正如我通过上面的链接和上面的 inline-comment 显示的那样,nodejs --version 可以,很好,没问题。这个问题是关于npm 和apt-get...现在我看到that part of the answer is here。
错误消息,same as this similar question
The following packages have unmet dependencies:
npm : Depends: nodejs but it is not going to be installed
Depends: node-abbrev (>= 1.0.4)
Depends: nodejs-dev
...
Depends: ... but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
【问题讨论】: