安装 react-native-firebase/storage 时出错……”`@react-native-firebase/app/lib.common 在 Haste 模块映射中不存在`”

Error installing react-native-firebase/storage......."`@react-native-firebase/app/lib.common does not exist in the Haste module map`"

我按照 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-firebase/app,这是 dwonload 的先决条件。先尝试下载 App firebase,然后再试。希望能帮助到你。否则随时提出任何疑问

npm i @react-native-firebase/storage

react-native link @react-native-firebase/storage

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" },