-1

I am trying to install a react-navigation drawer. on DOC instructions to install react-native-reanimated first and I installed. then I installed the drawer and got an error

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: app_mobile@0.0.1 npm ERR! Found: react-native-reanimated@2.3.0-beta.3 npm ERR! node_modules/react-native-reanimated npm ERR! react-native-reanimated@"^2.3.0-beta.2" 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@6.1.8 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\dell\AppData\Local\npm-cache\eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\dell\AppData\Local\npm-cache_logs\2021-10-21T08_17_02_306Z-debug.log'''

nima
  • 6,005
  • 8
  • 32
  • 48

1 Answers1

1

You can't use react-native-reanimated v2.x if you are using react-navigation v6, you need to install react-native-reanimated v1.x

# remove the library
npm remove react-native-reanimated

# install 1.x
npm i react-native-reanimated@1.x

You can see the peer dependencies of Drawer from here: https://github.com/react-navigation/react-navigation/blob/e77a5ab9d342a03cd8e20b54938700dfd4e23f42/packages/drawer/package.json#L68

ridvanaltun
  • 1,908
  • 1
  • 13
  • 23