【问题标题】:Error installing react-native-firebase/storage......."`@react-native-firebase/app/lib.common does not exist in the Haste module map`"安装 react-native-firebase/storage 时出错......“`@react-native-firebase/app/lib.common 在 Haste 模块映射中不存在`”
【发布时间】:2019-11-16 03:41:58
【问题描述】:

我按照 git 说明安装了包“react-native-firebase/storage”(npm install @react-native-firebase/storage --save

然后我用“import rnFb from '@react-native-firebase/storage'”导入包;

但是它给了我错误“@react-native-firebase/app/lib.common does not exist in the Haste module map

我尝试了错误消息中给出的说明..但无济于事

1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.

有人可以帮忙吗? 谢谢

更新 11/20 @react-native-firebase/storage 文件夹在 node_modules 文件夹中......但是“app”文件夹不是(这似乎是错误所抱怨的)

【问题讨论】:

    标签: react-native react-native-firebase


    【解决方案1】:

    我相信你还没有下载 @react-native-firebase/app 这是 dwonload 的先决条件。先试试下载App firebase,再试试。希望能帮助到你。否则请随时提出任何疑问

    【讨论】:

      【解决方案2】:

      cd 进入你的项目目录。 首先安装app包, yarn add @react-native-firebase/app 然后通过yarn add @react-native-firebase/storage安装存储包。 然后执行yarn install,安装的包就会链接到项目中。

      您可以通过检查package.json 文件来验证安装。 package.json 中的依赖项应如下所示。

      "dependencies": { "@react-native-firebase/app": "^6.0.4", "@react-native-firebase/storage": "^6.0.4", "react": "16.9.0", "react-native": "0.61.4", "react-native-gesture-handler": "^1.5.0", "react-navigation": "^4.0.10" },

      【讨论】:

        【解决方案3】:
        npm i @react-native-firebase/storage
        
        react-native link @react-native-firebase/storage
        

        【讨论】:

          猜你喜欢
          • 2019-11-16
          • 1970-01-01
          • 1970-01-01
          • 2022-07-06
          • 2020-11-02
          • 1970-01-01
          • 2021-09-06
          • 1970-01-01
          • 2022-09-24
          相关资源
          最近更新 更多