ng update
Updates your application and its dependencies. See https://update.angular.io/
ng update [options]
说明
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
To update to the next beta or pre-release version, use the --next=true
option.
To update from one major version to another, use the format ng update @angular/cli@^<major_version> @angular/core@^<major_version>
.
We recommend that you always update to the latest patch version, as it contains fixes we released since the initial major release. For example, use the following command to take the latest 7.x.x version and use that to update.
ng update @angular/cli@^7 @angular/core@^7
For detailed information and guidance on updating your application, see the interactive Angular Update Guide.
选项
选项 | 说明 |
---|---|
--all=true|false | Whether to update all packages in package.json. 默认值: |
--allowDirty=true|false | Whether to allow updating when the repository contains modified or untracked files. |
--createCommits=true|false | Create source control commits for updates and migrations. 默认值: 别名: -C |
--force=true|false | If false, will error out if installed packages are incompatible with the update. 默认值: |
--from=from | Version from which to migrate from. Only available with a single package being updated, and only on migration only. |
--help= | Shows a help message for this command in the console. 默认值: |
--migrateOnly=true|false | Only perform a migration, does not update the installed version. |
--next=true|false | Use the largest version, including beta and RCs. 默认值: |
--packages | The names of package(s) to update. |
--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. |
--verbose=true|false | Display additional details about internal operations during execution. 默认值: |