angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.39k stars 6.76k forks source link

bug(COMPONENT): Brand new install of an Angular project, could not install @angular/google-maps #30001

Closed lansana closed 1 week ago

lansana commented 1 week ago

Is this a regression?

The previous version in which this bug was not present was

No response

Description

I received this error when running npm i @angular/google-maps:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: ev-charger-search@0.0.0
npm error Found: @angular/common@17.3.12
npm error node_modules/@angular/common
npm error   @angular/common@"^17.3.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @angular/common@"^18.0.0 || ^19.0.0" from @angular/google-maps@18.2.12
npm error node_modules/@angular/google-maps
npm error   @angular/google-maps@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/REDACTED/.npm/_logs/2024-11-12T17_18_41_841Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/REDACTED/.npm/_logs/2024-11-12T17_18_41_841Z-debug-0.log

This was after a fresh install of an Angular project, using ng new <name>. I had to manually update via ng update @angular/core and retry in order to be able to install @angular/google-maps.

Reproduction

StackBlitz link: Steps to reproduce:

Expected Behavior

I should just be able to install @angular/google-maps after a fresh install of Angular and a new Angular project.

Actual Behavior

I received an error when installing @angular/google-maps after a fresh install of Angular and a new Angular project.

Environment

mmalerba commented 1 week ago

It looks like you had a project running angular version 17 and the latest google-maps at the time was version 18. You can update your app to angular 18 or add the older version of google maps npm i "@angular/google-maps@^17.0.0"