【发布时间】:2021-07-13 10:25:19
【问题描述】:
安装 react 导航抽屉时出现此错误。请帮忙。在安装抽屉导航器之前,我使用的是 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.
感谢您的帮助。
【问题讨论】:
-
这种情况何时发生?当你做 npm 安装?或者当您尝试构建应用程序时?请提供更多详细信息。
-
尝试删除package-lock.json或者使用yarn安装
-
@Gabriel Menezes da Silva,当我尝试通过运行命令“npm install react-navigation-drawer”安装抽屉导航时发生这种情况。运行此命令后,我的 cmd 给出了上述错误。
-
@Francesco Clementi,我该如何删除 package-lock.json。
-
@Francesco Clementi,删除 package-lock.json 不起作用,因为它抛出了同样的错误
标签: react-native react-native-navigation