Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install @react-navigation/material-bottom-tabs alongside release candidate #3451

Closed
jardvanroest opened this issue Nov 2, 2022 · 8 comments
Labels

Comments

@jardvanroest
Copy link

Current behaviour

@react-navigation/material-bottom-tabs can't be installed alongside release candidate.

Expected behaviour

I expect this to be possible, since the newest release candidate has a version >= 3.0.0

How to reproduce?

When I do npm i @react-navigation/material-bottom-tabs, it gives the error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: snelmelder@1.0.0
npm ERR! Found: react-native-paper@5.0.0-rc.9
npm ERR! node_modules/react-native-paper
npm ERR! react-native-paper@"^5.0.0-rc.9" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-paper@">= 3.0.0" from @react-navigation/material-bottom-tabs@6.2.4
npm ERR! node_modules/@react-navigation/material-bottom-tabs
npm ERR! @react-navigation/material-bottom-tabs@"*" 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\jardv\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\jardv\AppData\Local\npm-cache_logs\2022-11-02T15_13_49_745Z-debug-0.log

Preview

What have you tried so far?

I've tried using --force, which makes the code work, but of course this is not a permanent solution. I've also Googled to see if more people have this issue. There's an issue open on react-navigation about this, but the documentation of react-navigation recommends to post issues with material-bottom-tabs here instead of on their repo.

Your Environment

software version
react-native 0.68.2
react-native-paper ^5.0.0-rc.9
node 16.17.0
npm 8.15.1
expo sdk 46
@okwasniewski
Copy link
Member

Hey @jardvanroest,

Can you try installing this with yarn? Using this command: yarn add @react-navigation/material-bottom-tabs. It has better algorithm of resolving dependencies. And most probably will work 😄 If not please provide a minimal github repro repository were this problem occurs.

@chaudharykapil
Copy link

i also face this issue

@chaudharykapil
Copy link

it work well with react-native-paper": "^4.12.5",
and i used yarn instead of npm

@okwasniewski
Copy link
Member

I think I came up with a solution. There is an open proposal here to support this use case by npm. Right now @react-navigation/material-bottom-tabs has a peer dependency on react-native-paper as >= 3.0.0 but version 5.0.0-rc.9 is not being recognized as higher than 3.0.0.

A quick workaround for this would be to add this to your package.json

"overrides": {
    "@react-navigation/material-bottom-tabs": {
      "react-native-paper": "^5.0.0-rc.9"
    }
  }

Let me know if this fixes the issue 😀

@jardvanroest
Copy link
Author

@okwasniewski This workaround fixed it for me

@okwasniewski
Copy link
Member

Thanks @jardvanroest, closing this 👍🏻

@callstack callstack locked and limited conversation to collaborators Nov 5, 2022
@callstack callstack unlocked this conversation Nov 5, 2022
@lukewalczak lukewalczak pinned this issue Nov 5, 2022
@dwbra
Copy link

dwbra commented Nov 16, 2022

Thanks for this workaround!

@DevRSC
Copy link

DevRSC commented Nov 16, 2022

@okwasniewski, Thanks this workaround fixed my problem.

@lukewalczak lukewalczak unpinned this issue Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants