我在安装react导航抽屉时遇到这个错误。请帮帮忙。在安装drawer-navigator之前,我正在使用Stack-Navigator,它工作得很好。
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react-native-reanimated@2.2.0
npm ERR! node_modules/react-native-reanimated
npm ERR! react-native-reanimated@"~2.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-reanimated@"^1.0.0" from react-navigation-drawer@2.7.1
npm ERR! node_modules/react-navigation-drawer
npm ERR! react-navigation-drawer@"*" 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! See C:\Users\Hp\AppData\Local\npm-cache\eresolve-report.txt for a full report.谢谢你的帮助。
发布于 2021-07-14 12:06:21
该错误指出它在根目录下安装了react-native-reanimated,并将其作为react-navigation-drawer的依赖项。该错误似乎是对等依赖的问题。尝尝这个
npm install --legacy-peer-depsPS如果你没有使用react-native-reanimated,你可以从根文件夹中卸载它来修复这个错误。
发布于 2021-07-27 10:58:03
就像@Rohit所说的那样,这个错误的发生是因为与react-native-reanimated@2.2.0有一些冲突。我也尝试安装react-navigation-tabs,但也出现了错误。
因此,要安装软件包,请使用以下命令重试:
npm install --save --legacy-peer-deps react-navigation-tabshttps://stackoverflow.com/questions/68360647
复制相似问题