Issue
I have a Angular material project that is very outdated and I need to updated to 13
After running npm outdated
I see these results
According to the Angular update guide I need to upgrade only one mayor version at a time and it recommends these commands:
cmd /C "set "NG_DISABLE_VERSION_CHECK=1" && npx @angular/cli@8 update @angular/cli@8 @angular/core@8"
But after running that command I get these errors:
- Package "nativescript-angular" has an incompatible peer dependency to "typescript" (requires "~3.1.1", would install "3.5.3").
- Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0" (extended), would install "8.2.14").
- Package "codelyzer" has an incompatible peer dependency to "@angular/core" (requires ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0" (extended), would install "8.2.14").
- 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 "8.2.14").
- Package "nativescript-angular" has an incompatible peer dependency to "zone.js" (requires "^0.8.4", would install "0.9.1").
- Package "codelyzer" has an incompatible peer dependency to "@angular/platform-browser" (requires ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0" (extended), would install "8.2.14").
- Package "codelyzer" has an incompatible peer dependency to "@angular/platform-browser-dynamic" (requires ">=2.3.1<7.0.0 || >6.0.0-beta <7.0.0" (extended), would install "8.2.14").
- Incompatible peer dependencies found. See above.
I have tried to update each one of those packages by hand but it becomes a nightmare of dependencies, that currently I'm unable to solve.
I want to be able to upgrade to Angular 13 (doing the needed code changes) and I want to know what is correct way to address this problem.
UPDATE
When using --force also fails with a different error
When running this command:
ng update --all --force
Solution
You can use ng update --all --force
or npm install --save --legacy-peer-deps
. It basically avoids/ignores all the dependency-checks and updates all the packages wherever applicable. Although it is not recommended generally, I had to do the update this way as other suggestions seemed to be not working for me.
Answered By - shehan pathirathna
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.