【问题标题】:Error when installing npm in ubuntu 18.04在 ubuntu 18.04 中安装 npm 时出错
【发布时间】:2019-11-15 13:22:59
【问题描述】:

我已经安装了 node.js,但在尝试安装 npm 时出现此错误。

(base) yovel@the-beastpad:~$ sudo apt install 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.
(base) yovel@the-beastpad:~$

【问题讨论】:

  • npm 不是随 Node 一起提供的吗?至少npm says是这样的。

标签: node.js npm terminal


【解决方案1】:

试试

sudo apt-get install nodejs-dev node-gyp libssl1.0-dev
sudo apt-get install npm

【讨论】:

    【解决方案2】:

    你一定要试试这个

    首先用

    更新 apt
    sudo apt update
    

    然后

    sudo apt install npm 
    

    【讨论】:

    • 我试过这个。它不起作用。错误还是一样。
    猜你喜欢
    • 2020-03-05
    • 2018-12-19
    • 2023-03-22
    • 2021-03-24
    • 1970-01-01
    • 2019-06-17
    • 2019-05-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多