Note: The ng update
command allows for packages separated by spaces to be specified with additional arguments:
ng update [packages] [options]
Check out the ng update
command docs for more info.
This is because by default, the ng update
command when specified without any arguments/packages will try to update all of the packages if possible.
Here's the portion of the code of the update command which checks if no packages were specified:
if (options.all || packages.length === 0) {
// Either update all packages or show status
return this.runSchematic({
collectionName: '@schematics/update',
schematicName: 'update',
dryRun: !!options.dryRun,
showNothingDone: false,
additionalOptions: {
force: options.force || false,
next: options.next || false,
verbose: options.verbose || false,
packageManager,
packages: options.all ? Object.keys(rootDependencies) : [],
},
});
}
From the code above, this also means that either specifying the --all
option or not specifying any options at all will try to update all of the packages.
Note: You can view the entire source code of the update
command to see how the command works.