【问题标题】:E: unable to crorrect problems, apt-get install nodejsE:无法纠正问题,apt-get install nodejs
【发布时间】:2016-05-11 15:11:24
【问题描述】:

尝试在 Elementary OS 上安装 npm,但它给了我以下错误,任何关于如何解决此问题的建议???

以下包具有未满足的依赖关系:

npm : 取决于:nodejs 但它不会被安装
取决于:node-abbrev (>= 1.0.4) 但不会安装 取决于:node-ansi,但不会安装 取决于:node-archy,但不会安装 取决于:node-block-stream 但它不会被安装 取决于:node-fstream (>= 0.1.22) 但不会安装 取决于:node-fstream-ignore 但它不会被安装 取决于:node-github-url-from-git 但它不会被安装 取决于:node-glob (>= 3.1.21) 但它不会被安装 取决于:node-graceful-fs (>= 2.0.0) 但它不会被安装 取决于:node-inherits,但不会安装 取决于:node-ini (>= 1.1.0) 但不会安装 取决于:node-lockfile,但不会安装 取决于:node-lru-cache (>= 2.3.0) 但它不会被安装 取决于:node-minimatch (>= 0.2.11) 但不会安装 取决于:node-mkdirp (>= 0.3.3) 但它不会被安装 取决于:node-gyp (>= 0.10.9) 但不会安装 取决于:node-nopt (>= 2.1.1) 但不会安装 取决于:node-npmlog 但不会安装 取决于:node-once,但不会安装 取决于:node-osenv,但不会安装 取决于: node-read 但不会安装 取决于:node-read-package-json (>= 1.1.0) 但它不会被安装 取决于:node-request (>= 2.25.0) 但它不会被安装 取决于: node-retry 但它不会被安装 取决于:node-rimraf (>= 2.2.2) 但不会安装 取决于:node-semver (>= 2.1.0) 但不会安装 取决于:node-sha,但不会安装 取决于: node-slide 但不会安装 取决于:node-tar (>= 0.1.18) 但不会安装 取决于:node-which 但它不会被安装

【问题讨论】:

    标签: node.js ubuntu npm


    【解决方案1】:
    1. sudo apt-get update
    2. sudo apt-get install npm
    3. sudo apt-get install nodejs

    但是,你可能无法通过 apt 安装最新版本的 nodejs,而且,如果你想在 node 版本之间切换,也会很困难。

    我会推荐,使用NVM(节点版本管理器)

    使用 NVM 安装节点:

    1. wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
    2. source ~/.bashrc
    3. nvm install <node-version-you-want-to-install>

    有关 NVM 的更多信息,请参阅:https://github.com/creationix/nvm

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-22
      • 1970-01-01
      • 2020-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多