繁体   English   中英

无法解析 moudle firebase/auth

[英]Unable to resolve moudle firebase/auth

更新更改后出现错误“无法解析 moudle firebase/auth”

"@firebase/auth": "^0.20.11",
   "@firebase/firestore": "^3.4.12",
   "firebase": "9.9.0",

我尝试更改版本并独立安装 auth,但它不起作用。

消息错误说“在项目或这些目录中找不到 firebase/auth ...”

package.json:

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@babel/plugin-transform-runtime": "^7.14.5",
    "@callstack/react-theme-provider": "^3.0.8",
    "@expo/vector-icons": "^13.0.0",
    "@expo/webpack-config": "^0.17.3",
    "@react-native-aria/utils": "^0.2.7",
    "@react-native-community/datetimepicker": "6.5.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-toolkit/triangle": "^0.0.1",
    "@react-navigation/bottom-tabs": "^6.2.0",
    "@react-navigation/drawer": "^6.5.0",
    "@react-navigation/native": "6.0.13",
    "@react-navigation/native-stack": "^6.9.0",
    "@react-navigation/stack": "^6.3.4",
    "@stream-io/flat-list-mvcp": "^0.10.1",
    "base-64": "^1.0.0",
    "eas-cli": "^2.7.1",
    "expo": "^47.0.6",
    "expo-ads-admob": "~13.0.0",
    "expo-asset": "~8.6.2",
    "expo-auth-session": "~3.7.2",
    "expo-av": "~13.0.1",
    "expo-camera": "~13.0.0",
    "expo-constants": "~14.0.2",
    "expo-dev-client": "~2.0.0",
    "expo-facebook": "~12.2.0",
    "expo-image-picker": "~14.0.1",
    "expo-location": "~15.0.1",
    "expo-media-library": "~15.0.0",
    "expo-permissions": "~14.0.0",
    "expo-random": "~13.0.0",
    "firebase": "^9.14.0",
    "firesql": "~2.0.2",
    "idb": "^7.0.2",
    "lodash": "^4.17.21",
    "material-ui": "^0.15.0",
    "mathjs": "^11.4.0",
    "native-base": "^3.4.22",
    "pkg": "^5.8.0",
    "prop-types": "^15.7.2",
    "proptypes": "^1.1.0",
    "random-uuid-v4": "^0.0.9",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-error-boundary": "^3.1.3",
    "react-native": "0.70.5",
    "react-native-action-button": "^2.8.5",
    "react-native-audio": "^4.3.0",
    "react-native-aws3": "^0.0.9",
    "react-native-bidirectional-infinite-scroll": "^0.3.3",
    "react-native-camera": "^4.2.1",
    "react-native-easy-toast": "^2.0.0",
    "react-native-elements": "^4.0.0-rc.2",
    "react-native-fbsdk-next": "^11.1.0",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-gifted-chat": "^1.0.4",
    "react-native-google-mobile-ads": "^8.1.0",
    "react-native-image-crop-picker": "^0.38.1",
    "react-native-image-picker": "^4.0.6",
    "react-native-keyboard-aware-scroll-view": "^0.9.4",
    "react-native-mapbox-gl": "^5.2.1-deprecated",
    "react-native-maps": "1.3.2",
    "react-native-menu-list": "^1.0.1",
    "react-native-navbar": "^2.1.0",
    "react-native-open-maps": "~0.4.0",
    "react-native-paper": "^4.12.5",
    "react-native-reanimated": "~2.12.0",
    "react-native-router-flux": "^4.3.1",
    "react-native-safe-area-context": "^4.4.1",
    "react-native-screens": "^3.17.0",
    "react-native-snap-carousel": "^1.3.1",
    "react-native-sound": "^0.11.0",
    "react-native-swiper": "^1.6.0",
    "react-native-switch-selector": "^2.1.4",
    "react-native-video": "^5.2.1",
    "react-native-web": "~0.18.9",
    "react-navigation": "^4.4.4",
    "react-player": "^2.11.0",
    "react-scripts": "^5.0.1",
    "smartsocket": "^1.1.22",
    "styled-components": "^5.3.0",
    "use-debounce": "^8.0.4"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/node": "^18.11.9",
    "babel-preset-expo": "~9.2.2"
  },
  "private": true
}

无法解析 firebas/auth

在你的项目根目录终端运行这个npm i @firebase/auth

我通过更改 som 依赖项解决了这个问题:

    yarn add react-native@0.68.5
npx react-native start --reset-cache
npm install firebase@9.6.11
npm audit fix --force

yarn add react-native-dialog

将 expo 降级为 45.0.6

和其他依赖项

现在我的 package.json 是:

  {
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@babel/plugin-transform-runtime": "^7.14.5",
    "@callstack/react-theme-provider": "^3.0.8",
    "@expo/vector-icons": "^13.0.0",
    "@expo/webpack-config": "^0.17.3",
    "@react-native-aria/utils": "^0.2.7",
    "@react-native-community/datetimepicker": "6.1.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-toolkit/triangle": "^0.0.1",
    "@react-navigation/bottom-tabs": "^6.2.0",
    "@react-navigation/drawer": "~5.10.0",
    "@react-navigation/native": "6.0.13",
    "@react-navigation/native-stack": "^6.9.0",
    "@react-navigation/stack": "^5.10.0",
    "@react-query-firebase/auth": "^1.0.0-dev.2",
    "@stream-io/flat-list-mvcp": "^0.10.1",
    "base-64": "^1.0.0",
    "eas-cli": "^2.7.1",
    "expo": "45.0.6",
    "expo-ads-admob": "~13.0.0",
    "expo-asset": "~8.5.0",
    "expo-auth-session": "~3.6.1",
    "expo-av": "~11.2.3",
    "expo-camera": "~12.2.0",
    "expo-constants": "~13.1.1",
    "expo-dev-client": "~1.0.1",
    "expo-facebook": "~12.2.0",
    "expo-image-picker": "~13.1.1",
    "expo-location": "~14.2.2",
    "expo-media-library": "~14.1.0",
    "expo-permissions": "~13.2.0",
    "expo-random": "~12.2.0",
    "firebase": "^9.6.11",
    "firesql": "~2.0.2",
    "idb": "^7.0.2",
    "lodash": "^4.17.21",
    "material-ui": "^0.20.2",
    "mathjs": "^11.4.0",
    "native-base": "^3.4.22",
    "node": "^16.18.1",
    "pkg": "^5.8.0",
    "prop-types": "^15.8.1",
    "proptypes": "^1.1.0",
    "random-uuid-v4": "^0.0.9",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-error-boundary": "^3.1.3",
    "react-native": "0.68.2",
    "react-native-action-button": "^2.8.5",
    "react-native-audio": "^4.3.0",
    "react-native-aws3": "^0.0.9",
    "react-native-bidirectional-infinite-scroll": "^0.3.3",
    "react-native-camera": "^4.2.1",
    "react-native-dialog": "^9.3.0",
    "react-native-easy-toast": "^2.0.0",
    "react-native-elements": "~1.2.7",
    "react-native-fbsdk-next": "^11.1.0",
    "react-native-gesture-handler": "~2.2.1",
    "react-native-gifted-chat": "^1.0.4",
    "react-native-google-mobile-ads": "^8.1.0",
    "react-native-image-crop-picker": "^0.38.1",
    "react-native-image-picker": "^4.0.6",
    "react-native-keyboard-aware-scroll-view": "^0.9.4",
    "react-native-mapbox-gl": "^5.2.1-deprecated",
    "react-native-maps": "0.30.2",
    "react-native-menu-list": "^1.0.1",
    "react-native-navbar": "^2.1.0",
    "react-native-open-maps": "~0.4.0",
    "react-native-paper": "^4.12.5",
    "react-native-reanimated": "~2.8.0",
    "react-native-router-flux": "^4.3.1",
    "react-native-safe-area-context": "4.2.4",
    "react-native-screens": "~3.11.1",
    "react-native-snap-carousel": "~3.9.0",
    "react-native-sound": "^0.11.0",
    "react-native-swiper": "^1.6.0",
    "react-native-switch-selector": "^2.1.4",
    "react-native-video": "^5.2.1",
    "react-native-web": "0.17.7",
    "react-navigation": "^4.4.4",
    "react-player": "^2.11.0",
    "react-scripts": "^5.0.1",
    "smartsocket": "^1.1.22",
    "styled-components": "^5.3.0",
    "use-debounce": "^3.4.2"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/node": "^18.11.9",
    "babel-preset-expo": "~9.2.2",
    "check-dependencies": "^1.1.0"
  },
  "private": true
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM