question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Peer dependency issue

See original GitHub issue

Is 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:

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Defrostedcommented, Dec 15, 2022

Try npm install react-native-elements --legacy-peer-deps

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 👍

2reactions
relensecommented, Dec 12, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found