Search code examples
angulargoogle-mapsnpmdependency-managementagm-core

npm ERESOLVE Error When Installing @agm/core with Angular 16.2.3


npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"^16.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^9.1.0 || ^10.0.0" from @agm/[email protected]
npm ERR! node_modules/@agm/core
npm ERR!   @agm/core@"*" from the root project

Unable to Install @agm/core with Angular 16.2.3

Problem

I'm working on an Angular project that requires Google Maps integration. I tried to install the @agm/core package, but I'm getting an npm ERR! ERESOLVE error.

My project uses Angular version 16.2.3, specified in package.json as:

"@angular/common": "^16.1.0",

I want to install Angular Google Maps (AGM) in my Angular project

  1. Is there a version of @agm/core that is compatible with Angular 16?
  2. Are there alternative libraries or approaches to integrate Google Maps without downgrading Angular?

Solution

  • This library is not supported anymore as you can see on the repo.

    Per the peer deps it only supports v9/10. Also the support for non-ivy libs has been dropped in v16, so even if you forced install the deps, it wouldn't work.