Introduction
Upgrading a real Angular application from v19 to v22 may seem intimidating, but Angular's built-in migration tools make the process smooth and predictable. The recommended approach is to upgrade one major version at a time so that migrations are applied safely.
This guide explains:
Exact commands to run
What the Angular CLI output means
Validation steps after each upgrade
Best practices to avoid common issues
Upgrade Path: Angular 19 → 22
Angular major versions should be upgraded sequentially:
19 → 20 → 21 → 22Each upgrade uses:
ng update @angular/core@<version> @angular/cli@<version>Step 1: Upgrade Angular 19 → 20
1. Check Available Updates
Run:
ng updateMeaning
Angular CLI will:
Read versions from
package.jsonCompare them with available versions
Recommend update commands
Show packages requiring migration
2. CLI Output Example
You may see something similar to:
@angular-eslint/schematics 19.2.0 -> 20.x.x
@angular/cdk 19.2.0 -> 20.x.x
@angular/cli 19.2.0 -> 20.x.x
@angular/core 19.2.0 -> 20.x.xMeaning
Left side = your current version
Right side = recommended target version
Angular suggests migration commands
Update Commands
Update Angular Core & CLI
ng update @angular/cli@20 @angular/core@20Update Angular CDK
If using Angular Material:
ng update @angular/cdk@20Update Angular ESLint
ng update @angular-eslint/schematicsValidate the Application
Run:
ng serveng testng build --configuration productionFix any compilation or test issues.
Commit your code:
git add .
git commit -m "Angular 19 to 20 upgrade"Step 2: Upgrade Angular 20 → 21
1. Check Updates
Run:
ng update2. CLI Output Example
You may see something similar to:
@angular-eslint/schematics 20.x.x -> 21.x.x
@angular/cdk 20.x.x -> 21.x.x
@angular/cli 20.x.x -> 21.x.x
@angular/core 20.x.x -> 21.x.xUpdate Commands
Update Angular Core & CLI
ng update @angular/cli@21 @angular/core@21Update Angular CDK
ng update @angular/cdk@21Update Angular ESLint
ng update @angular-eslint/schematicsValidate the Application
Run:
ng serveng testng build --configuration productionFix any compilation or test issues.
Commit your code:
git add .
git commit -m "Angular 20 to 21 upgrade"Step 3: Upgrade Angular 21 → 22
1. Check Updates
Run:
ng update2. CLI Output Example
You may see something similar to:
@angular-eslint/schematics 21.x.x -> 22.x.x
@angular/cdk 21.x.x -> 22.x.x
@angular/cli 21.x.x -> 22.x.x
@angular/core 21.x.x -> 22.x.xUpdate Commands
Update Angular Core & CLI
ng update @angular/cli@22 @angular/core@22Update Angular CDK
ng update @angular/cdk@22Update Angular ESLint
ng update @angular-eslint/schematicsValidate the Application
Run:
ng serveng testng build --configuration productionFix any compilation or test issues.
Commit your code:
git add .
git commit -m "Angular 21 to 22 upgrade"Post-Upgrade Verification
Verify project versions:
ng versionExpected output:
Angular CLI: 22.x.x
Angular: 22.x.x
TypeScript: Compatible Version
Node: Supported VersionCommon Issues and Fixes
Dependency Conflicts
Check outdated packages:
npm outdatedUpdate remaining dependencies:
npm updateClean Install
If packages become inconsistent:
rm -rf node_modules
rm package-lock.jsonThen run:
npm installAngular Material Issues
If you're using Angular Material:
ng update @angular/materialor:
ng update @angular/cdkFinal Upgrade Checklist
Step | Status |
|---|---|
Upgrade 19 → 20 | ✅ |
Run Build & Tests | ✅ |
Upgrade 20 → 21 | ✅ |
Run Build & Tests | ✅ |
Upgrade 21 → 22 | ✅ |
Run Build & Tests | ✅ |
Verify | ✅ |
Deploy to Test Environment | ✅ |
Best Practice
Always commit your code after every major version upgrade:
19 → 20 → Commit
20 → 21 → Commit
21 → 22 → CommitThis makes troubleshooting much easier and allows quick rollback if any migration introduces issues.
Summary
Upgrading Angular from version 19 to 22 should be performed sequentially through versions 20 and 21 rather than attempting to jump directly to version 22. Using ng update, validating the application after each migration, running tests and production builds, and committing the changes after every major upgrade provides a structured approach for managing the migration. Checking dependencies, performing a clean installation when necessary, and verifying the final Angular, TypeScript, and Node versions can help identify and resolve common upgrade issues.

Join the conversation! Your thoughts help the community grow.