Google maps react failed to install.I have tried with the command
npm install --save google-maps-react.But the following error occurred.
You have react 17.n installed, and that dependency says it needs react 14.n, 15.n or 16.n
Hello there,
This might be of some use: GitHub - google-map-react/google-map-react: Google map library for react that allows rendering components as markers
Otherwise, following the npm
advice: Version 2.1.9 (?) reports broken dependency on react@^16.0,0 · Issue #995 · google-map-react/google-map-react · GitHub
Hope this helps
So,what’s your advice ?What should I do? I am a beginner.
So either use a different library, as @Sky020 says – the first link is a different library that should work (there are a few React libraries that people have made for Google maps and, unfortunately, they all have very similar names).
Or downgrade your React installation. This isn’t a great solution, but you can do it like npm install --save react@16.14
, the number after the @
is the version
Oh man… I did not even notice that
Such similar names should be illegal.
Those map libraries are the worst for names, especially the ones that wrap Google Maps. Not just GM though, it’s most map library wrappers (eg using Mapbox at work & I recently changed the library from react-mapbox-gl to react-map-gl)
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.