Peer dependency issue
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Explain what you did
I wanted to install latest packages with npm.
Expected behavior
That everything works fine with npm install.
Describe the bug
When I run npm i it gives an error because of dependecies.
"react-native-elements": "^3.4.2",
"react-native-safe-area-context": "^4.4.1",
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-native-elements@3.4.2
npm ERR! Found: react-native-safe-area-context@4.4.1
npm ERR! node_modules/react-native-safe-area-context
npm ERR! react-native-safe-area-context@"^4.4.1" from the root project
npm ERR! peer react-native-safe-area-context@">= 3.0.0" from @react-navigation/bottom-tabs@6.4.3
npm ERR! node_modules/@react-navigation/bottom-tabs
npm ERR! @react-navigation/bottom-tabs@"^6.4.0" from the root project
npm ERR! 2 more (@react-navigation/elements, @react-navigation/stack)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-safe-area-context@"^3.1.9" from react-native-elements@3.4.2
npm ERR! node_modules/react-native-elements
npm ERR! react-native-elements@"^3.4.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native-safe-area-context@3.4.1
npm ERR! node_modules/react-native-safe-area-context
npm ERR! peer react-native-safe-area-context@"^3.1.9" from react-native-elements@3.4.2
npm ERR! node_modules/react-native-elements
npm ERR! react-native-elements@"^3.4.2" 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 /Users/miguelfurtado/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/miguelfurtado/.npm/_logs/2022-12-05T11_04_46_223Z-debug-0.log
This started happening when I updated expo sdk version which in turn updated react-native-safe-area-acontext library. This is the issue I opened with expo.
Steps To Reproduce
Install react-native-elements, then install react-native-safe-area-context.
Screenshots
No response
Your Environment
`npx @rneui/envinfo`
```
React Native Elements Env Info
Global Dependencies:
No related dependency found
Local Dependencies:
- expo : ^47.0.0
- react : 18.1.0
- react-native : 0.70.5
- react-native-elements : ^3.4.2
- @types/react : ~18.0.24
- @types/react-native : ~0.70.6
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How do I fix the npm UNMET PEER DEPENDENCY warning?
UNMET PEER DEPENDENCY error is thrown when the dependencies of one or more modules specified in the package.
Read more >Understanding Peer Dependencies in JavaScript
Peer dependencies are almost like normal dependencies, but instead of defining a strong requirement between A and B (i.e the project you're ...
Read more >Resolve npm peer dependency issues using the ... - Medium
Resolve npm peer dependency issues using the npm view command. Have you ever gotten an error like this? You don't just ignore these…...
Read more >How to fix npm dependency hell - Sylhare's blog
How to fix npm dependency hell · Some context · Audit · Check your package.json and package-lock.json · Check what's installed · Update...
Read more >Addressing the shortcomings of peer dependencies - HackMD
Peer dependencies are intended to help reduce duplicate installs in applications by allowing libraries to opt out of introducing them, yet fall short...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, this is not exactly a solution, just a temporary work-around. I don’t want to perform the
npm install
with--legacy-peer-deps
each time, as that opens the door for a lot of other issues. Would appreciate an update to this as soon as possible 👍Hi @arpitBhalla, thanks for your input. I did and that works, but doesn’t actually solve the issue it just bipasses. The dependecy issue is still there which is problematic to use with expo and to build for a deploy.