📅  最后修改于: 2020-10-27 02:44:44             🧑  作者: Mango
ng update [options]
ng update命令更新应用程序及其依赖项。选项是可选参数。
Sr.No. | Argument & Syntax | Description |
---|---|---|
1 | The keyword to search for, as provided in the search bar in angular.io. |
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 Aliases: -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 |
首先转到使用ng build命令更新的角度项目。
现在运行更新命令。现在ng将使用npm更新依赖项。
\>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!