react-navigation / react-navigation/react-navigation

Could not resolve dependency

Open
#10,649 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug platform:android platform:ios platform:macos repro provided
Dominant language
TypeScript
Stars
24.5k
Forks
5.1k
Avg merge
1d 5h
Merged PRs (30d)
18

Description

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: test-navigation@1.0.0
npm ERR! Found: @react-navigation/native@5.9.8
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/compat@5.3.20
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/native@6.0.10
npm ERR! node_modules/@react-navigation/native
npm ERR!   peer @react-navigation/native@"^6.0.0" from @react-navigation/stack@6.2.1
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 git@github.com: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
  • Android
  • iOS
  • Web
  • Windows
  • 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
  • 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the listed npm installation steps or clone the linked reproduction repository to confirm the ERESOLVE conflict. Inspect the dependency declarations for @react-navigation/compat, @react-navigation/native, and @react-navigation/stack, then verify that a compatible package combination installs without errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, react-native
Domain
mobile-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.