What is the difference between ng update and npm update?

Issue

Would someone please explain the difference between ng update in Angular 6 and npm update?

Solution

ng update: Updates the current application to latest versions.

Just like Web and the entire web ecosystem, Angular is continuously improving. Angular balances continuous improvement with a strong focus on stability and making updates easy. Keeping your Angular app up-to-date enables you to take advantage of leading-edge new features, as well as optimizations and bug fixes.

This document contains information and resources to help you keep your Angular apps and libraries up-to-date.

npm update: This command will update all the packages listed to the latest version (specified by the tag config), respecting semver.

It will also install missing packages. As with all commands that install packages, the –dev flag will cause devDependencies to be processed as well.

If the -g flag is specified, this command will update globally installed packages.

If no package name is specified, all packages in the specified location (global or local) will be updated.

As of [email protected], the npm update will only inspect top-level packages. Prior versions of npm would also recursively inspect all dependencies. To get the old behavior, use npm –depth 9999 update.

As of [email protected], the npm update will change package.json to save the new version as the minimum required dependency. To get the old behavior, use npm update –no-save.

sources:
https://github.com/angular/angular-cli/wiki/update
https://docs.npmjs.com/cli/update

Answered By – Ayoub k

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published