react-navigation icon indicating copy to clipboard operation
react-navigation copied to clipboard

Could not resolve dependency

Open RodolfoGS opened this issue 3 years ago • 0 comments

Current behavior

I can't install the latest versions of @react-navigation/compat + @react-navigation/native + @react-navigation/stack

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @react-navigation/[email protected]
npm ERR! node_modules/@react-navigation/native
npm ERR!   @react-navigation/native@"*" from the root project
npm ERR!   peer @react-navigation/native@"^5.0.5" from @react-navigation/[email protected]
npm ERR!   node_modules/@react-navigation/compat
npm ERR!     @react-navigation/compat@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @react-navigation/stack@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @react-navigation/[email protected]
npm ERR! node_modules/@react-navigation/native
npm ERR!   peer @react-navigation/native@"^6.0.0" from @react-navigation/[email protected]
npm ERR!   node_modules/@react-navigation/stack
npm ERR!     @react-navigation/stack@"*" 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!

How to reproduce:

  1. mkdir test
  2. cd test
  3. npm i @react-navigation/compat @react-navigation/native @react-navigation/stack
  4. You have the error

Another way to reproduce it is cloning the super simple repository that I created with the previous steps:

  1. git clone [email protected]:RodolfoGS/react-navigation-conflict.git
  2. cd react-navigation-conflict
  3. npm i
  4. You have the error

Expected behavior

I expect that the dependences are installed without errors

Reproduction

https://github.com/RodolfoGS/react-navigation-conflict

Platform

  • [X] Android
  • [X] iOS
  • [ ] Web
  • [ ] Windows
  • [X] MacOS

Packages

  • [ ] @react-navigation/​bottom-tabs
  • [ ] @react-navigation/​drawer
  • [ ] @react-navigation/​material-bottom-tabs
  • [ ] @react-navigation/​material-top-tabs
  • [ ] @react-navigation/​stack
  • [ ] @react-navigation/​native-stack

Environment

  • [x] I've removed the packages that I don't use
package version
@react-navigation/native 6.0.10
@react-navigation/stack 6.2.1
@react-navigation/compat 5.3.20
node 16.15.1
npm 8.11.0

RodolfoGS avatar Jun 23 '22 00:06 RodolfoGS