inastall @agm-core on angular14

when trying to install agm-core, get error

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: undefined@undefined npm ERR! Found: @angular/[email protected] npm ERR! node_modules/@angular/common npm ERR! @angular/common@"^14.0.4" 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@"^3.0.0-beta.0" from the root project npm ERR! peer @agm/core@"^3.0.0-beta.0" from @angular-material-extensions/[email protected] npm ERR! node_modules/@angular-material-extensions/google-maps-autocomplete npm ERR! @angular-material-extensions/google-maps-autocomplete@"*" 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. npm ERR! npm ERR! See C:\Users\user\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\user\AppData\Local\npm-cache_logs\2022-07-05T09_18_32_425Z-debug-0.log

Upvotes: 0

Views: 8259

Answers (2)

Hudson Tavares
Hudson Tavares

Reputation: 161

After the frustration of waiting for an update on @agm/core for years (the last release was 3 years ago), I forked and made an Angular 14-compatible version myself (package).

All you need to do is to run npm i @hudsontavares/agm-core and replace the @agm/core references inside your code.

Upvotes: 3

SeppeDev
SeppeDev

Reputation: 2302

You could try to install agm/core with --legacy-peer-deps. This is because this npm package contains outdated requirements for older Angular versions (version <=8) and that aborts the install.

npm install @agm/core --legacy-peer-deps

Upvotes: 4

Related Questions