Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not resolve dependency...peer @angular/compiler@"15.2.0" from @angular/[email protected] #347

Open
mattvbv opened this issue Mar 4, 2023 · 1 comment

Comments

@mattvbv
Copy link

mattvbv commented Mar 4, 2023

When following the instructions to make it run, I get this error at the npm install stage :

$ npm install npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: @angular/[email protected] npm ERR! node_modules/@angular/compiler npm ERR! @angular/compiler@"15.1.5" from the root project npm ERR! peer @angular/compiler@"15.1.5" from @angular/[email protected] npm ERR! node_modules/@angular/localize npm ERR! @angular/localize@"15.1.5" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/compiler@"15.2.0" from @angular/[email protected] npm ERR! node_modules/@angular/compiler-cli npm ERR! dev @angular/compiler-cli@"15.2.0" 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.

My environment (Ubuntu 22.04) :

npm version { 'sb-admin-angular14-bs5': '10.0.0', npm: '9.6.0', node: '18.14.2', v8: '10.2.154.26-node.22', uv: '1.44.2', zlib: '1.2.13', brotli: '1.0.9', ares: '1.18.1', modules: '108', nghttp2: '1.51.0', napi: '8', llhttp: '6.0.10', uvwasi: '0.0.14', acorn: '8.8.1', simdutf: '3.1.0', undici: '5.20.0', openssl: '3.0.8+quic', cldr: '42.0', icu: '72.1', tz: '2022g', unicode: '15.0', ngtcp2: '0.8.1', nghttp3: '0.7.0' }.

Let me add that I didn't have npm and nodejs installed before I upgraded nodejs version with the "npm install -g n" thing.

Thanks for the help.

@mattvbv
Copy link
Author

mattvbv commented Mar 4, 2023

Got it working with

npm install --save --legacy-peer-deps

And I also had to fix those two lines in angular.json :

$ grep -R "chart.js/dist/Chart.js" angular.json: "scripts": ["node_modules/chart.js/dist/Chart.js"], angular.json: "scripts": ["node_modules/chart.js/dist/Chart.js"],
and update this to chart.js/dist/chart.js (lowercase chart.js)

Now it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant