react-native - 如何解决导航包
问题描述
每当我尝试运行 Navigation for React Native 项目的安装命令来创建抽屉时,我都会收到以下错误,这是我尝试过的命令
npm install @react-navigation/native
我收到以下错误
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR! react@"^17.0.1" from the root project
npm ERR! peer react@"*" from react-native-reanimated@1.9.0
npm ERR! node_modules/react-native-reanimated
npm ERR! react-native-reanimated@"~1.9.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.8.6" from react-native@0.60.6
npm ERR! node_modules/react-native
npm ERR! react-native@"^0.60.5" from the root project
npm ERR! peer react-native@"*" from react-native-reanimated@1.9.0
npm ERR! node_modules/react-native-reanimated
npm ERR! react-native-reanimated@"~1.9.0" 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 install --save --legacy-peer-deps
。如果不起作用,请参阅:
推荐阅读
- python - Pandas:在数据框的组中添加行
- javascript - 按索引将 2 个分块数组映射在一起
- java - 将 GetMethods 用于一个类而不是另一个类时出现 NullPointException
- html - 动态创建列表卡 angularjs 仪表板
- kubernetes - Kubernetes PVC 数据持久化
- ruby-on-rails - 如何在具有 HABTM 的视图中使用关联模型
- jsp - c:当测试表达式返回假时
- linux - make dtbs 返回“没有规则来制作目标 'dtbs'”
- reporting-services - SSRS 报告正在传递给非订阅者
- javascript - React 应用程序构建无法将 SVG 作为组件加载,但它适用于开发