How to use the Angular CLI update command line

Created

Perform a basic update to the current stable release of the core framework and CLI by running the following command.

ng update
ng update @angular/cli @angular/core
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 28 dependencies.
Fetching dependency metadata from registry...

For example, use the following command to take the latest 10.x.x version and use that to update.

ng update
ng update @angular/cli@^10 @angular/core@^10

The Angular CLI update Help Commands and Options

Usage: 
  ng update [options]

Options:
--all default:false
Deprecated Whether to update all packages in package.json.
--allow-dirty
Whether to allow updating when the repository contains modified or untracked files.
--create-commits default:false
Create source control commits for updates and migrations. Aliases: -C
--force default:false
Ignore peer dependency version mismatches. Passes the --force flag to the package manager when installing packages.
--from
Version from which to migrate from. Only available with a single package being updated, and only on migration only.
--help default:false
Shows a help message for this command in the console.
--migrate-only
Only perform a migration, do not update the installed version.
--next default:false
Use the prerelease version, including beta and RCs.
--packages
The names of package(s) to update.
--to
Version up to which to apply migrations. Only available with a single package being updated, and only on migrations only. Requires from to be specified. Default to the installed version detected.
--verbose default:false
Display additional details about internal operations during execution.

Related Tags