Cant resolve dependency on Boilerplate project

I've downloaded a Angular 5 / .NET 5 project, and normally when I run the command npm install, I don't have any problems.

But since yesterday when downloading a project and running this command I get this error:

C:\Users\ca\source\repos\CCM\angular\src>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@"^10.2.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@">=2.3.1 <10.0.0 || >9.0.0-beta <10.0.0 || >9.1.0-beta <10.0.0 || >9.2.0-beta <10.0.0" from [email protected]
npm ERR! node_modules/codelyzer
npm ERR!   dev codelyzer@"^5.1.2" 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\ca\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\ca\AppData\Local\npm-cache\_logs\2021-03-24T08_34_44_177Z-debug.log

Normally I don't have any problem with this command so I'm wondering if it's a problem with my setup or with the project.

I can submit the full report if requested.

Upvotes: 6

Views: 2302

Answers (2)

LordMsz
LordMsz

Reputation: 194

Found out that codelyzer is actually not needed for Angular 13 and newer, see Codelyzer requires Angular 9 instead of Angular 10.

Original answer before finding out:

As suggested in codelyzer GitHub issue mentioned in the other answer, upgrading codelyzer helped me:

  1. Upgrade codelyzer to version to "^6.0.0"
  2. Remove "package-lock.json"
  3. Remove node_modules folder
  4. npm install works now

I know it's an old question, but it happened to me having Angular 13 project working normally and then break. Not really sure why now, though.

Upvotes: 0

Modar Na
Modar Na

Reputation: 918

considering the line

npm ERR! peer @angular/compiler@">=2.3.1 <10.0.0 || >9.0.0-beta <10.0.0 || >9.1.0-beta <10.0.0 || >9.2.0-beta <10.0.0" from [email protected]

the error is from the [email protected] dependencies, I found this closed issue on github which indicates that it is not really a problem
running npm install --legacy-peer-deps could solve it, for more information check this out.

Upvotes: 6

Related Questions