0

I am trying to add react-map-gl-draw to my application on top of react-map-gl; however, the error I get is the following:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react-map-gl@6.1.18
npm ERR! node_modules/react-map-gl
npm ERR!   react-map-gl@"^6.1.18" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-map-gl@"^5.x" from react-map-gl-draw@1.0.2-alpha.0
npm ERR! node_modules/react-map-gl-draw
npm ERR!   react-map-gl-draw@"*" 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.

I haven't been able to find anyone suffering from the same problem. I would appreciate it if anyone could lend me a hand. Thank you.

2 Answers2

0

I had a similar issue, this helped me. Namely, the flag (--legacy-peer-deps) for installing packages.

anboch
  • 1
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/33001257) – Thomas Smyth - Treliant Oct 28 '22 at 10:30
0

Use the --force command like this:

npm install react-map-gl-draw --force
SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
Arif
  • 1