Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
424 views
in Technique[技术] by (71.8m points)

npm - Incompatible peer dependency (using ng update @angular/core) - clarifying message

I am updating my Angular project to 11.0.5 by running the command below:

ng update @angular/[email protected]

An error message that comes is as follows:

Package "codelyzer" has an incompatible peer dependency to "@angular/common" (requires ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0" (extended), would install "11.0.5")

Questions:

  1. If Angular were to be updated to 11.0.5, does this mean the existing codelyzer will not run as it is only compatible with Angular within this version bracket: >=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0?
  2. How do I interpret "would install 11.0.5"? Does it mean by running the command ng update @angular/[email protected], this will update Angular to 11.0.5, of which the consequences are it will be incompatible with the existing version of codelyzer?
  3. In most SO cases, people have suggested running the update with the --force flag. Is the correct way to update codelyzer first? Then only update Angular to 11.0.5?

Thanks.

question from:https://stackoverflow.com/questions/65649573/incompatible-peer-dependency-using-ng-update-angular-core-clarifying-messag

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Angular has deprecated the use of Codelyzer

We’re deprecating the use of TSLint and Codelyzer in version 11. This means that in future versions the default implementation for linting Angular projects will not be available. The ng lint command will function similarly to ng deploy, suggesting recommended implementations developers could add to their projects.

So basically Angular is recommending the use of eslint. If you have upgraded to angular 11 then I suggest that you also migrate to using eslint by following the steps in the official Angular documentation

If Angular were to be updated to 11.0.5, does this mean the existing codelyzer will not run as it is only compatible with Angular within this version bracket: >=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0?

If you install with --force flag codelyzer will run. But the major problem is that in future versions of Angular as this is being deprecated, this will be removed so better to upgrade as recommended

How do I interpret "would install 11.0.5"? Does it mean by running the command ng update @angular/[email protected], this will update Angular to 11.0.5, of which the consequences are it will be incompatible with the existing version of codelyzer?

Yes, this will update several versions of dependencies to Angular 11.0.5. I did update my project to Angular 11 using the --force flag but didn't experience any difference in how codelyzer worked.

In most SO cases, people have suggested running the update with the --force flag. Is the correct way to update codelyzer first? Then only update Angular to 11.0.5?

If you need to update then due to the incompatible dependencies, without the --force flag then the command will fail. You can use the --force flag and after a successful install update resolve the warnings raised like migrating from tslint to eslint


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...