To update a globally installed Angular package, we can use the npm command line tool.
// let's update the angular CLI which previously was installed globally
npm update -g @angular/cli
PS: Note that we may need administrative privileges (permissions) to update global packages.
Variante II
We can also use the following command format on our command line: ( For example, let assume we want to update Angular CLI to version 17.0.0)
npm install -g @angular/cli@17.0.0
After updating, we can check whether the package was updated successfully by running the following command:
ng v
This displays the installed Angular CLI version. If the update was successful, we should see the new version.