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.

Unable to resolve peer dependency with latest version of React.

See original GitHub issue

Describe the bug Erro to install dependency in a new react app.


❯ npm install react-hook-form --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: web-ui@0.1.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from react-hook-form@6.9.6
npm ERR! node_modules/react-hook-form
npm ERR!   react-hook-form@"*" 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/tiare/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/tiare/.npm/_logs/2020-10-27T22_29_19_838Z-debug.log

To Reproduce Steps to reproduce the behavior:

  1. Create a new app with create-react-app
  2. Run command npm install react-hook-form --save
  3. Installation will be rejected.

Codesandbox link (Required) N/A

Expected behavior Be able to install dependency with success

Screenshots If applicable, add screenshots to help explain your problem. Screenshot 2020-10-27 at 22 31 21

Desktop (please complete the following information):

  • OS: Mac OSX
  • Browser Chrome
  • Version
  • Node: v15.0.1
  • NPM: 7.0.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
realadamsmithcommented, Mar 4, 2021

@jorisre just checked with node -v came out to v12.19.0 npm -v came out to 7.6.0

I’m not sure if these are the latest, or if its okay if they’re not the latest

1reaction
tiarebalbicommented, Oct 27, 2020

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not resolve dependency error peer react@"^16.8.0
this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Read more >
npm ERR! Could not resolve dependency peer react [Solved]
The error "npm ERR! Could not resolve dependency peer react" occurs because since NPM version 7, npm tries to automatically install peer dependencies....
Read more >
Could not resolve dependency peer react@"^16.12.0 ... - GitHub
To get the old behaviour, run npm install with --legacy-peer-deps , as they say in the error message. I'm not really sure how...
Read more >
could not resolve dependency peer react@ ^16.0.0 - You.com
Solution 1: Ignore the peerDependencies The easiest way to fix the issue is to pass an additional parameter –legacy-peer-deps to npm install. The...
Read more >
Unable to resolve dependency tree error in Angular while ...
When using npm 7, Unable to resolve dependency tree errors comes up a lot because peer dependencies issues are treated as errors in...
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