React Native Firebase依赖冲突:无法解析对等依赖求助
React Native Firebase 依赖冲突问题求助
我正在使用React Native Firebase开发应用,此前遇到过编译错误,排查后推测是包依赖冲突导致的。尝试更新@react-native-firebase/app和@react-native-firebase/firestore时,出现了「Could not resolve peer dependency」的警告/错误。
核心问题:@react-native-firebase/firestore要求@react-native-firebase/app版本为18.7.3,但实际安装的是18.8.0,不确定是否需要降级处理。
执行npm install --save @react-native-firebase/app的错误日志
npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: ez_dollar_v0.2@1.0.0 npm WARN Found: @react-native-firebase/app@18.8.0 npm WARN node_modules/@react-native-firebase/app npm WARN @react-native-firebase/app@"^18.8.0" from the root project npm WARN npm WARN Could not resolve dependency: npm WARN peer @react-native-firebase/app@"18.7.3" from @react-native-firebase/auth@18.7.3 npm WARN node_modules/@react-native-firebase/auth npm WARN @react-native-firebase/auth@"^18.7.3" from the root project npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: ez_dollar_v0.2@1.0.0 npm WARN Found: @react-native-firebase/app@18.8.0 npm WARN node_modules/@react-native-firebase/app npm WARN @react-native-firebase/app@"^18.8.0" from the root project npm WARN npm WARN Could not resolve dependency: npm WARN peer @react-native-firebase/app@"18.7.3" from @react-native-firebase/firestore@18.7.3 npm WARN node_modules/@react-native-firebase/firestore npm WARN @react-native-firebase/firestore@"^18.7.3" from the root project added 2 packages, and audited 1185 packages in 5s 66 packages are looking for funding run `npm fund` for details 5 moderate severity vulnerabilities To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details.
执行npm install --save @react-native-firebase/firestore的错误日志
npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @react-native-firebase/auth@18.7.3 npm ERR! Found: @react-native-firebase/app@18.8.0 npm ERR! node_modules/@react-native-firebase/app npm ERR! @react-native-firebase/app@"^18.8.0" from the root project npm ERR! peer @react-native-firebase/app@"18.8.0" from @react-native-firebase/firestore@18.8.0 npm ERR! node_modules/@react-native-firebase/firestore npm ERR! @react-native-firebase/firestore@"18.8.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @react-native-firebase/app@"18.7.3" from @react-native-firebase/auth@18.7.3 npm ERR! node_modules/@react-native-firebase/auth npm ERR! @react-native-firebase/auth@"^18.7.3" from the root project npm ERR! npm ERR! Conflicting peer dependency: @react-native-firebase/app@18.7.3 npm ERR! node_modules/@react-native-firebase/app npm ERR! peer @react-native-firebase/app@"18.7.3" from @react-native-firebase/auth@18.7.3 npm ERR! node_modules/@react-native-firebase/auth npm ERR! @react-native-firebase/auth@"^18.7.3" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! /Users/benfirstenberg/.npm/_logs/2024-01-27T16_59_24_206Z-eresolve-report.txt npm ERR! A complete log of this run can be found in: /Users/benfirstenberg/.npm/_logs/2024-01-27T16_59_24_206Z-debug-0.log
已尝试在安装命令后追加@latest,但未解决问题。
内容的提问来源于stack exchange,提问作者Ben Firsty
相关产品推荐
相关产品推荐

