0

I am new to react.js . My applicaition is base on google map . I tried to integrate with react js but it show follwoing error :

enter image description here

PS E:\FYP\demo projects\map\my-app> npm install --save google-maps-react
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: my-app@0.1.0
npm ERR! Found: react@18.2.0
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@"~0.14.8 || ^15.0.0 || ^16.0.0" from google-maps-react@2.0.6
Failed to compile.

Here is the code :

import './App.css';
import {Map, InfoWindow, Marker, GoogleApiWrapper} from 'google-maps-react';
import React from "react";
 

function App() {
  return (
    <div className="App">
      <header className="App-header">
      <Map google={this.props.google} zoom={14}>
 
 <Marker onClick={this.onMarkerClick}
         name={'Current location'} />

 <InfoWindow onClose={this.onInfoWindowClose}>
     <div>
       <h1>{this.state.selectedPlace.name}</h1>
     </div>
 </InfoWindow>
</Map>
      </header>
    </div>
  );
}

export default GoogleApiWrapper({ apiKey: ("AIzaSyBwl84ZlMZeFUjUxCQK0MMEh5QL_0SRtfI")
})(App)
ERROR in ./src/App.js 5:0-78
Module not found: Error: Can't resolve 'google-maps-react' in 'E:\FYP\demo projects\map\my-app\src'
Konrad
  • 21,590
  • 4
  • 28
  • 64
  • Does this answer your question? [Unable to resolve dependency tree error when installing npm packages](https://stackoverflow.com/questions/64573177/unable-to-resolve-dependency-tree-error-when-installing-npm-packages) – Konrad Nov 18 '22 at 12:59
  • No, its still not working. I tried with yarn also . – Tayyab Mughal Nov 18 '22 at 16:49

0 Answers0