Unable to resolve dependency tree after v14 release of Angular
See original GitHub issueDescribe 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:
- Download the latest v13 Angular CLI (v13.3.7 as of this post)
- Create a new Angular application using
ng new
- Try to install the latest ngx-charts (v20.1.0 as of this post)
- 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:
- Created a year ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is failling on my ci pipeline with
npm ci --legacy-peer-deps
on thenx build
step. Do you guys have any solution? I’m getting the errorI encountered same problem. I fixed building with
ng install --legacy-peer-deps