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

ERESOLVE unable to resolve dependency tree with npm@7 and react@17 #3

Open
SimonGolms opened this issue Jul 12, 2021 · 0 comments
Open

Comments

@SimonGolms
Copy link

SimonGolms commented Jul 12, 2021

A clean install with npm@7+ and react@17+ throws the following error message and can currently only be fixed with npm install --force as workaround.

$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: my-project@1.0.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.3.0 || ^16.0.0" from react-expand-collapse@0.2.0
npm ERR! node_modules/react-expand-collapse
npm ERR!   react-expand-collapse@"^0.2.0" 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 /home/<USER>/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/<USER>/.npm/_logs/2021-07-12T05_32_56_555Z-debug.log

Update peerDependencies in your package.json should do the trick:

"peerDependencies": {
"react": "^15.3.0 || ^16.0.0",
"react-dom": "^15.3.0 || ^16.0.0"
},

-   "react": "^15.3.0 || ^16.0.0", 
+   "react": "^15.3.0 || ^16.0.0 || ^17.0.0", 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant