首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在安装抽屉导航时解决此反应本机错误

如何在安装抽屉导航时解决此反应本机错误
EN

Stack Overflow用户
提问于 2021-07-13 18:25:19
回答 2查看 944关注 0票数 1

我在安装react导航抽屉时遇到这个错误。请帮帮忙。在安装drawer-navigator之前,我正在使用Stack-Navigator,它工作得很好。

代码语言:javascript
复制
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.

谢谢你的帮助。

EN

回答 2

Stack Overflow用户

发布于 2021-07-14 12:06:21

该错误指出它在根目录下安装了react-native-reanimated,并将其作为react-navigation-drawer的依赖项。该错误似乎是对等依赖的问题。尝尝这个

代码语言:javascript
复制
npm install --legacy-peer-deps

PS如果你没有使用react-native-reanimated,你可以从根文件夹中卸载它来修复这个错误。

票数 2
EN

Stack Overflow用户

发布于 2021-07-27 10:58:03

就像@Rohit所说的那样,这个错误的发生是因为与react-native-reanimated@2.2.0有一些冲突。我也尝试安装react-navigation-tabs,但也出现了错误。

因此,要安装软件包,请使用以下命令重试:

代码语言:javascript
复制
npm install --save --legacy-peer-deps react-navigation-tabs
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68360647

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档