【问题标题】:How To Install Node Js In Ubuntu 18.10?如何在 Ubuntu 18.10 中安装 Node Js?
【发布时间】:2021-05-04 17:24:07
【问题描述】:

我正在尝试在 Ubuntu 18.10 中安装 nodejs,但它返回一些错误。

The following packages have unmet dependencies:
 nodejs : Depends: python-minimal but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

以上是我在通过 cammand 安装 node Js 时收到的消息:sudo apt-get install nodejs。

【问题讨论】:

  • 您是否至少尝试在 Google 上搜索“无法纠正问题,您的包裹已损坏。” ?

标签: node.js ubuntu


【解决方案1】:

link中所述:

安装节点版本管理器:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash

激活 nvm:

. ~/.nvm/nvm.sh

使用nvm安装你想要的node版本:

nvm install 4.4.5

测试是否安装了 Node.js:

node -e "console.log('Running Node.js ' + process.version)"

【讨论】:

  • 当然。我会这样做的!
【解决方案2】:

Ubuntu下recommended安装node的方式似乎是使用NodeSource提供的档案。

他们的指令是运行这些 shell 命令,大概是设置 PPM 并从该源安装当前版本的 node

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

【讨论】:

    【解决方案3】:

    首先您需要使用以下命令安装 python 2.7

    sudo add-apt-repository ppa:deadsnakes/ppa
    sudo apt-get update
    sudo apt-get install python2.7
    

    然后安装nodejs

    sudo apt-get install nodejs
    

    【讨论】:

      【解决方案4】:

      使用 Ubuntu

      curl -fsSL https://deb.nodesource.com/setup_15.x |须藤 -E bash - sudo apt-get install -y nodejs

      以 root 身份使用 Debian

      curl -fsSL https://deb.nodesource.com/setup_15.x |重击 - apt-get install -y nodejs

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-11-04
        • 2015-03-06
        • 1970-01-01
        • 2019-08-16
        • 2020-05-10
        • 2019-06-28
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多