React 17 install problem!
See original GitHub issueCannot install in a React 17 project.
package.json:
"dependencies": {
"axios": "^0.21.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
"react-scripts": "^4.0.2",
"react-router-dom": "^5.2.0",
"react-helmet-async": "^1.0.7",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"redux-logger": "^3.0.6",
"socket.io-client": "^3.1.1"
},
"devDependencies": {
"@craco/craco": "^6.1.1",
"compression-webpack-plugin": "6.1.1",
"webpack-bundle-analyzer": "^4.4.0"
},
Error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR! peer react@">= 16" from react-scripts@4.0.2
npm ERR! node_modules/react-scripts
npm ERR! peer react-scripts@"^4.0.0" from @craco/craco@6.1.1
npm ERR! node_modules/@craco/craco
npm ERR! dev @craco/craco@"^6.1.1" from the root project
npm ERR! react-scripts@"^4.0.2" from the root project
npm ERR! react@"^17.0.1" from the root project
npm ERR! 1 more (recharts)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0.0" from react-resize-detector@5.2.0
npm ERR! node_modules/recharts/node_modules/react-resize-detector
npm ERR! react-resize-detector@"^5.2.0" from recharts@2.0.4
npm ERR! node_modules/recharts
npm ERR! recharts@"*" 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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
React v17.0 – React Blog
We're fixing many of those problems with React 17. ... Refer to the documentation for detailed installation instructions.
Read more >Can't install on React 17 create-react-app project · Issue #1420
Hi, As the title says, npm won't install react-vis on a create-react-app project with React 17. Here's the console error log: npm ERR!...
Read more >React - Error while updating from 17.0.1 to 17.0.2 [duplicate]
I'm using npm v 7.4. It seems that some dependencies are incompatible with react 17. Do I understand correctly? But npm shows e....
Read more >Fix Error We no longer support global installation of ... - YouTube
Fix ErrorYou are running create- react -app 4.0.3 which is behind the latest release 5.0.0We no longer support global installation of Create ...
Read more >Troubleshooting | React Navigation
Sometimes it might even be due to a corrupt installation. If clearing cache didn't work, try deleting your node_modules folder and run npm...
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
Part of OP’s error is regarding react-resize-detector, which isn’t an NPM bug, since the version in recharts for resize-detector doesn’t include major versions. I’m currently facing the same issue and, even though --legacy-peer-deps works, it would be ideal that the dependency is updated in recharts.
Should I open another ticket for this or reopen this one?
Could not resolve dependency: npm ERR! peer react@"^16.0.0" from react-resize-detector@5.2.0 npm ERR! node_modules/recharts/node_modules/react-resize-detector npm ERR! react-resize-detector@"^5.2.0" from recharts@2.0.6 npm ERR! node_modules/recharts npm ERR! recharts@"^2.0.3" from the root project
@idastambuk I bumped
react-resize-detector
on my abandoned PR #2426 https://github.com/recharts/recharts/pull/2426/commits/18b0aa69d993d26846c29eacde5ad15eaefb9092 and it seemed well.Thanks for pointing out the issue, I opened #2431 with the detail.