question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to resolve dependency tree after v14 release of Angular

See original GitHub issue

Describe the bug Now that Angular v14 is out and all corresponding components have been bumped, ngx-charts fails to properly install on a v13 CLI built app.

To Reproduce Steps to reproduce the behavior:

  1. Download the latest v13 Angular CLI (v13.3.7 as of this post)
  2. Create a new Angular application using ng new
  3. Try to install the latest ngx-charts (v20.1.0 as of this post)
  4. An npm error is throw because of incompatibility with v14 of @angular/common and/or @angular/cdk

Expected behavior The npm package installs successfully on a v13 Angular app

Screenshots If applicable, add screenshots to help explain your problem.

Demo Provide an online demo (stackblitz, codesandbox, or similar) where the issue can be reproduced

ngx-charts version 20.1.0

Additional context Below is the error you will get:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ngx-charts-test@0.0.0
npm ERR! Found: @angular/common@13.3.11
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"~13.3.0" from the root project
npm ERR!   peer @angular/common@">=12.0.0" from @swimlane/ngx-charts@20.1.0
npm ERR!   node_modules/@swimlane/ngx-charts
npm ERR!     @swimlane/ngx-charts@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^14.0.0 || ^15.0.0" from @angular/cdk@14.0.0
npm ERR! node_modules/@angular/cdk
npm ERR!   peer @angular/cdk@">=12.0.0" from @swimlane/ngx-charts@20.1.0
npm ERR!   node_modules/@swimlane/ngx-charts
npm ERR!     @swimlane/ngx-charts@"*" 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!

Workaround For now I have specified an override for the @angular/cdk to ensure the latest v13 of this transient dependency is used during an npm install

  "overrides": {
    "@angular/cdk": "13.3.9"
  }

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
leoffxcommented, Jun 15, 2022

This is failling on my ci pipeline with npm ci --legacy-peer-deps on the nx build step. Do you guys have any solution? I’m getting the error

./node_modules/@swimlane/ngx-charts/fesm2015/swimlane-ngx-charts.mjs:6:0-71 - Error: Module not found: Error: Can't resolve '@angular/cdk/portal' in '/home/runner/work/blu/blu/node_modules/@swimlane/ngx-charts/fesm2015'
1reaction
symonfly82commented, Jun 14, 2022

I encountered same problem. I fixed building with ng install --legacy-peer-deps

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to resolve dependency tree error when installing npm ...
You have dependency conflict (incorrect and potentially broken dependency) as it says, so try to run the command with --force , or --legacy-peer ......
Read more >
Unable to resolve dependency tree error in Angular while ...
To fix Unable to resolve dependency tree error in Angular while installing `npm` packages follow the below steps. 1.
Read more >
ERESOLVE unable to resolve dependency tree when npm ...
How do you fix the dependency tree conflict in react? · Remove node_modules folder and package-lock. · Run npm install –force instead of...
Read more >
unable to resolve dependency tree angular - You.com
You have dependency conflict (incorrect and potentially broken dependency) as it says, so try to run the command with --force , or --legacy-peer-deps...
Read more >
Workspace npm dependencies - Angular
The following support packages are included as dependencies in the default package.json file for a new Angular workspace. Package name, Details. rxjs, Many ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found