Unable to resolve dependency tree
AltaraceO opened this issue · comments
When attempting to install react-usa-map on linux (npm install react-usa-map --save)
I got the following errors:
While resolving: react-app@0.1.0
Found: react@17.0.2
node_modules/react
react@"^17.0.2" from the root project
Could not resolve dependency:
peer react@"^16.13.1" from react-usa-map@1.5.0
node_modules/react-usa-map
react-usa-map@"*" from the root project
Any suggestions on how to resolve this issue?
I had this problem a month or so ago. The only way I was able to resolve it was to change my react and react-dom dependences both to ^16.13.1
. If you're not using any version 17-specific features of react, this may work for you. @gabidavila says on her bio page that she needs help with this repo, so I wouldn't expect version 17 compatibility soon.
The library can be installed without having to downgrade to version 16 of react
and react-dom
by using the --force
option when installing it:
npm i --save react-usa-map --force
This --force
option will also need to be specified when running npm install
or npm ci
.
I'm using React 17 and it works great.
Thanks for the tip. I must admit that I'm hesitant to use --force
on production code, as that could allow other potentially serious incompatibilities to be bypassed.