【问题标题】:Cannot install redux through npm?无法通过 npm 安装 redux?
【发布时间】:2016-06-14 18:44:36
【问题描述】:

运行 npm install redux 会报错:

npm ERR! fetch failed https://registry.npmjs.org/lodash-es/-/lodash-es-4.6.0.tgz npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 404

我认为它与 lodash-es 相关,因为我也无法安装它。不过,其他所有软件包都可以正常工作。

【问题讨论】:

标签: node.js reactjs npm lodash redux


【解决方案1】:

我遇到了同样的错误。我得到了 404 和 502 状态码。听起来在 npm 上托管包一定有问题。我也在尝试通过 npm 安装 redux。

我通过在我的 package.json 中更改 lodash-es 的版本来临时修复它

"lodash-es": "~4.0.0"

【讨论】:

    【解决方案2】:

    错误 404 表示所需的包不适用于当前版本的 npm。您应该尝试更新 npm 本身。

    >$ sudo npm install npm -g
    >$ password:
    

    sudo 在您的情况下可能是可选的。

    【讨论】:

      猜你喜欢
      • 2017-12-10
      • 2011-09-01
      • 2013-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-12
      • 2017-03-28
      • 2012-04-05
      相关资源
      最近更新 更多