How to use the Angular CLI update command line
Perform a basic update to the current stable release of the core framework and CLI by running the following command.
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 @angular/[email protected]^10 @angular/[email protected]^10
The Angular CLI update Help Commands and Options
Usage: ng update [options] Options:--all default:falseDeprecated Whether to update all packages in package.json.--allow-dirtyWhether to allow updating when the repository contains modified or untracked files.--create-commits default:falseCreate source control commits for updates and migrations. Aliases: -C--force default:falseIgnore peer dependency version mismatches. Passes the --force flag to the package manager when installing packages.--fromVersion from which to migrate from. Only available with a single package being updated, and only on migration only.--help default:falseShows a help message for this command in the console.--migrate-onlyOnly perform a migration, do not update the installed version.--next default:falseUse the prerelease version, including beta and RCs.--packagesThe names of package(s) to update.--toVersion 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:falseDisplay additional details about internal operations during execution.