Angular CLI – ng update Command

Angular CLI - ng update Command

In this Angular CLI ng update Command chapter explains the syntax, argument and options of ng update command along with an example. So all the details of Angular CLI ng update Command listed below-

Syntax

The syntax for ng update command is as follows −

ng update [options]

ng update command updates the application and its dependencies.

Arguments

The argument for ng update command is as follows −

Sr.No.Argument & SyntaxDescription
1<keyword>The keyword to search for, as provided in the search bar in angular.io.

Options

Options are optional parameters.

Sr.No.Option & SyntaxDescription
1–all=true|falseWhether to update all packages in package.json.Default: false
2–allowDirty=true|falseWhether to allow updating when the repository contains modified or untracked files.
3–createCommits=true|falseCreate source control commits for updates and migrations.Default: falseAliases: -C
4–force=true|falseIf false will error out if installed packages are incompatible with the update.Default: false
5–from=fromVersion from which to migrate from. Only available with a single package being updated, and only on migration only.
6–help=true|false|json|JSONShows a help message for this command in the console. Default: false
7–migrateOnly=true|falseOnly perform a migration, does not update the installed version.
8–next=true|falseUse the largest version, including beta and RCs.Default: false
9–packagesThe names of the package(s) to update.
10–to=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.
11–verbose=true|falseDisplay additional details about internal operations during execution.Default: false

First, move to an angular project updated using ng build command. The chapter is available at https://adglob.in/blog/angular-cli-ng-build-command/.

Now run the update command. Now ng will update dependencies using npm.

Example

An example for ng update command is given below −

\>Node\>Adglob> ng update
Using package manager: 'npm'
Collecting installed dependencies...
Found 31 dependencies.
   We analyzed your package.json and everything seems to be in order. Good work!

Next Topic : Click Here

Leave a Reply