0

I have project in angular 8 with metronic after updating to angular 10 when I try to install npm i every time getting this error.

npm ERR! While resolving: metronic-angular@6.1.8

npm ERR! Found: @angular/common@10.2.5

  npm ERR! ERESOLVE unable to resolve dependency tree.
  npm ERR!
  npm ERR! While resolving: metronic-angular@6.1.8
  npm ERR! Found: @angular/common@10.2.5
  npm ERR! node_modules/@angular/common.
  npm ERR!   @angular/common@"^10.2.5" from the root project
  npm ERR!
  npm ERR! Could not resolve dependency:
  npm ERR! peer @angular/common@"^8.0.0 || ^9.0.0-0" from @angular/cdk@8.2.3
  npm ERR! node_modules/@angular/cdk
  npm ERR!   @angular/cdk@"^8.2.3" 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.

here is the screenshot.

error screen

any help will be appreciated Thanks.

n_dev
  • 101
  • 8
  • 1
    metronic-angular is a paid template? Did a bit of googling doesn't seem they have version 6 anywhere anymore to look into. What it does look like is metronic-angular@v6 does not support angular 10+ only v8 and v9 based on the error log. You can try --legacy-peer-deps or --force but you may or may not encounter issues. – penleychan Apr 01 '22 at 17:26
  • so any answer how can I upgrade it with anuglar? – n_dev Apr 01 '22 at 17:52
  • Best bet is to contact the developer, as they seem to have version 7 and 8 of metronic-angular which support higher version of angular. I don't know if you need to pay or not for those version but as of now there's nothing you can do with metronic-angular@6.1.8 with any angular version >9. – penleychan Apr 01 '22 at 19:01

1 Answers1

0

Could you attach the package.json please? It looks like @angular/cdk has not been increased to v10. I recently had a similar issue while updating angular even with the correct version specified. I fixed by:

  • Deleting node_modules - can be done via command rm -rf node_modules
  • Deleting package-lock.json
  • Re-running npm install
Jonathan
  • 34
  • 3