Npm dependency issue: react 17.0.2 and "react-swipeable-views
Problem Description:
I’m trying to add react-swipeable-views
library to my Project, but I get the following error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.3.0 || ^16.0.0 || ^17.0.0" from [email protected]
npm ERR! node_modules/react-swipeable-views
npm ERR! react-swipeable-views@"0.14.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!
How can I resolve this?
Solution – 1
you can try to add –legacy-peer-deps OR –force at the end of the install command as mentioned in the error you got