- Angular CLI - Code Coverage
- Angular CLI - ng xi18n
- Angular CLI - ng update
- Angular CLI - ng doc
- Angular CLI - ng config
- Angular CLI - ng analytics
- Angular CLI - ng add
- Angular CLI - ng e2e
- Angular CLI - ng test
- Angular CLI - ng lint
- Angular CLI - ng serve
- Angular CLI - ng run
- Angular CLI - ng build
- Angular CLI - ng generate
- Angular CLI - ng help
- Angular CLI - ng new
- Angular CLI - ng version
- Angular CLI - Environment Setup
- Angular CLI - Overview
- Angular CLI - Home
Angular CLI Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Angular CLI - ng update Command
This chapter explains the syntax, argument and options of ng update command along with an example.
Syntax
The syntax for ng update command is as follows −
ng update [options]
ng update command updates the apppcation and its dependencies.
Arguments
The argument for ng update command is as follows −
Sr.No. | Argument & Syntax | Description |
---|---|---|
1 | <keyword> | The keyword to search for, as provided in the search bar in angular.io. |
Options
Options are optional parameters.
Sr.No. | Option & Syntax | Description |
---|---|---|
1 | --all=true|false | Whether to update all packages in package.json. Default: false |
2 | --allowDirty=true|false | Whether to allow updating when the repository contains modified or untracked files. |
3 | --createCommits=true|false |
Create source control commits for updates and migrations. Default: false Apases: -C |
4 | --force=true|false |
If false, will error out if installed packages are incompatible with the update. Default: false |
5 | --from=from | Version from which to migrate from. Only available with a single package being updated, and only on migration only. |
6 | --help=true|false|json|JSON |
Shows a help message for this command in the console. Default: false |
7 | --migrateOnly=true|false | Only perform a migration, does not update the installed version. |
8 | --next=true|false |
Use the largest version, including beta and RCs. Default: false |
9 | --packages | The names of package(s) to update. |
10 | --to=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. |
11 | --verbose=true|false |
Display 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
Now run the update command. Now ng will update dependencies using npm.
Example
An example for ng update command is given below −
>Node>TutorialsPoint> 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!Advertisements