【问题标题】:Unable to add firebase to react app with "npm install firebase"无法使用“npm install firebase”添加 firebase 以响应应用程序
【发布时间】:2021-01-25 11:08:16
【问题描述】:

我正在尝试将 firebase 添加到我的 react 应用程序中。但是当我输入 npm install firebase 时,我收到了奇怪的错误,例如: 在“错误消息”附近解析时 JSON 输入意外结束。 错误消息每次运行 npm install firebase 时都会有所不同。我看过这些问题:

  1. Firebase npm install error
  2. Unable to do "npm install --save firebase"
  3. Firebase - Failing to install firebase using npm but yarn works 我尝试了 npm cache clean --force,并且在 npm update 之后,但没有奏效。我也尝试过降级 npm,但都没有奏效。我也试过卸载节点,然后重新安装,但这也没有帮助。提前谢谢

npm 版本 6.13.7


节点版本 v12.19.0

【问题讨论】:

    标签: node.js reactjs firebase npm


    【解决方案1】:

    确定删除package-lock.json 并删除带有rm -rf node_modules 的node_modules 文件夹怎么样?

    然后再npm install

    祝你好运。

    【讨论】:

      【解决方案2】:

      看起来 npm 缓存已损坏,但由于 npm cache clean --force 不起作用,删除 C:\Users\User\AppData\Roaming\npm-cache 中的 _cacache 目录解决了我的问题。之后 npm install 工作很好。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-02-29
        • 2019-05-09
        • 1970-01-01
        • 1970-01-01
        • 2020-09-19
        • 2018-08-18
        • 2018-03-13
        相关资源
        最近更新 更多