【问题标题】:Error! You've attempted to require '@react-native-firebase/auth' version '6.2.0', however错误!但是,您尝试要求 '@react-native-firebase/auth' 版本 '6.2.0'
【发布时间】:2020-02-25 17:01:10
【问题描述】:

错误!您尝试要求 @react-native-firebase/auth 版本“6.2.0”,但是,@react-native-firebase/app 模块的版本不同 (6.3.4)。

每当我启动应用程序时都会收到此错误。我尝试重新安装所有模块,删除并重新安装,将所有 react 本机 firebase 模块安装到版本 6.3.4,到版本 6.2.0,但仍然没有。 我不能使用 firebase 包,因为我以不同的方式实现了 firebase。 你知道我该怎么做吗?

包.json:

  "name": "Vanto",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-firebase/app": "^6.2.0",
    "@react-native-firebase/auth": "^6.2.0",
    "@react-native-firebase/storage": "^6.2.0",
    "@types/react": "^16.9.17",
    "@types/react-native": "^0.60.31",
    "jetifier": "^1.6.5",
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-admob": "^2.0.0-beta.6",
    "react-native-appearance": "^0.3.1",
    "react-native-gesture-handler": "^1.5.3",
    "react-native-image-picker": "^2.3.0",
    "react-native-ionicons": "^4.6.4",
    "react-native-navigation-bar-color": "^1.0.0",
    "react-native-reanimated": "^1.4.0",
    "react-native-restart": "0.0.14",
    "react-native-splash-screen": "^3.2.0",
    "react-native-typescript-transformer": "^1.2.13",
    "react-native-vector-icons": "^6.6.0",
    "react-navigation": "^4.0.10",
    "react-navigation-stack": "^1.10.3",
    "react-navigation-tabs": "^2.6.2",
    "styled-components": "^5.0.1",
    "typescript": "^3.7.5",
    "uninstall": "0.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.6.2",
    "@babel/runtime": "^7.6.2",
    "@react-native-community/eslint-config": "^0.0.5",
    "babel-jest": "^24.9.0",
    "eslint": "^6.5.1",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.56.0",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

【问题讨论】:

  • 你能添加你的 package.json 吗?这会发生在 android 和 ios 上吗?
  • 添加了 package.json,我只为 android 构建
  • 从表面上看,您缺少 react-native-firebase 包
  • 使用@react-native-firebase;在官方文档中,他们说首先要添加 @react-native-firebase/app,这就是包本身
  • auth 和 storage 只是完成,但主包是 app 的

标签: firebase react-native react-native-firebase


【解决方案1】:

在 6.2.0 中通过清理节点缓存和纱线缓存以及重新安装 react 本机 firebase 模块来修复

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-19
    • 2018-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多