I am getting the following error while updating from React 17.0.1 to 17.0.2. It's not entirely clear to me why the dependencies are causing problems. 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. g.
npm ERR! peer react-dom@"^15.0.0 || ^16.0.0 || ^17.0.0" from react-calendly@2.0.0
npm ERR! node_modules/react-calendly
If I think correct, React 17 should work.
Could someone explain the problem to me briefly? Is there a solution for this?
Error:
npm install --save react@17.0.2
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"17.0.2" from the root project
npm ERR! peer react@"^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" from mini-create-react-context@0.4.1
npm ERR! node_modules/mini-create-react-context
npm ERR! mini-create-react-context@"^0.4.0" from react-router@5.2.0
npm ERR! node_modules/react-router
npm ERR! react-router@"5.2.0" from react-router-dom@5.2.0
npm ERR! node_modules/react-router-dom
npm ERR! react-router-dom@"^5.2.0" from the root project
npm ERR! 7 more (react-calendly, react-icons, react-router, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from react-dom@17.0.1
npm ERR! node_modules/react-dom
npm ERR! peer react-dom@"^15.0.0 || ^16.0.0 || ^17.0.0" from react-calendly@2.0.0
npm ERR! node_modules/react-calendly
npm ERR! react-calendly@"^2.0.0" from the root project
npm ERR! peer react-dom@"^15.5.4 || ^16.0.0 || ^17.0.0" from react-scroll@1.8.2
npm ERR! node_modules/react-scroll
npm ERR! react-scroll@"^1.8.2" from the root project
npm ERR! 2 more (styled-components, 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!
My dependencies:
"emailjs-com": "^2.6.4",
"react": "^17.0.1",
"react-calendly": "^2.0.0",
"react-dom": "^17.0.1",
"react-icons": "^4.2.0",
"react-router-dom": "^5.2.0",
"react-router-scroll-top": "^0.2.1",
"react-scripts": "^4.0.3",
"react-scroll": "^1.8.2",
"styled-components": "^5.3.0",
"swiper": "^6.5.0"
I don't understand, why 17.0.0 should be working, but 17.0.2 not.
Thanks for your help.