Unable to resolve peer dependency with latest version of React.
See original GitHub issueDescribe 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:
- Create a new app with create-react-app
- Run command
npm install react-hook-form --save
- 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.
Desktop (please complete the following information):
- OS: Mac OSX
- Browser Chrome
- Version
- Node: v15.0.1
- NPM: 7.0.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top 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 >
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 Free
Top 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
@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
Thanks!