0

Trying to install angular-highcharts to my angular project but I m getting the error below:

PS C:\Users\YUNUS\Desktop\newProject\gos-panel\src\app\shared> npm i angular-highcharts highcharts       

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: gos-panel@0.0.0 npm ERR! Found: @angular/common@14.1.0 npm ERR! node_modules/@angular/common npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/common@"^13.0.0" from angular-highcharts@14.1.5 npm ERR! node_modules/angular-highcharts npm ERR! angular-highcharts@"*" 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\YUNUS\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\YUNUS\AppData\Local\npm-cache_logs\2022-07-25T13_43_51_090Z-debug-0.log

  • Answer here https://stackoverflow.com/questions/72575853/how-to-resolve-dependency-conflict-while-installing-bootstrap-using-angular-cli/72576028#72576028 – Robin Webb Jul 25 '22 at 13:55
  • downgrade `angular-highcharts` version to support your `Angular` version. https://www.npmjs.com/package/angular-highcharts/v/13.0.1 – paranaaan Jul 26 '22 at 02:43
  • Recommend using the official package [Highcharts angular](https://www.npmjs.com/package/highcharts-angular) and [wrapper](https://github.com/highcharts/highcharts-angular), it's better documented and fully supported. – Sebastian Hajdus Jul 26 '22 at 05:30

1 Answers1

0

You can check peer dependencies for angular-highcharts as below.

npm info angular-highcharts peerDependencies

Result:

 '@angular/common': '^13.0.0', '@angular/core': '^13.0.0' }

Note that angular-highcharts requires @angular/common and @angular/core version 13.n.n.

You are using version @angular/common@14.1.0 it appears.

Please either install Angular 13 or work around the issue by using the command:

npm i angular-highcharts highcharts --legacy-peer-deps

As per the error above though, this peer dependency hasn't necessarily been tested.

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.

Robin Webb
  • 1,355
  • 1
  • 8
  • 15