Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cannot install ngx-graph with Angular 13.3

I have an Angular v13.3 project in which I’m trying to install the v8.0.0 of ngx-graph. When I run the command

npm install @swimlane/ngx-graph --save

I get the following output.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: demo-ui@0.0.0
npm ERR! Found: rxjs@7.5.5
npm ERR! node_modules/rxjs
npm ERR!   rxjs@"~7.5.0" from the root project
npm ERR!   peer rxjs@"^6.5.3 || ^7.4.0" from @angular/core@13.3.1
npm ERR!   node_modules/@angular/core
npm ERR!     @angular/core@"~13.3.0" from the root project
npm ERR!     peer @angular/core@"10.x || 11.x || 12.x || 13.x" from @swimlane/ngx-graph@8.0.0
npm ERR!     node_modules/@swimlane/ngx-graph
npm ERR!       @swimlane/ngx-graph@"*" from the root project
npm ERR!     3 more (@angular/animations, @angular/cdk, @angular/common)
npm ERR!   2 more (@angular/cdk, @angular/common)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer rxjs@"6.x" from @swimlane/ngx-graph@8.0.0
npm ERR! node_modules/@swimlane/ngx-graph
npm ERR!   @swimlane/ngx-graph@"*" 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.

I haven’t used npm for a long time, so I’m not really sure what this means. It appears that the versions of rxjs that Angular and ngx-graph require are in conflict.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

npm install @swimlane/ngx-graph --save --legacy-peer-deps

a couple of versions ago, npm started automatically for peer deps. Use the above command to workaround that.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading