

npm update -global npm update express -gīoth -global and -g do the same thing. Npm update will update packages globally if the global flag is specified.

Using the -save flag is important for updating the package.json.įor more information on updating packages to a specific version, see npm install | how it works. If you want to update a package to specific version, use npm install with the specified tag instead. npm update express npm update to specific version If packages are specified then only those packages will be updated. npm update -save-dev npm update -devīoth -save-dev and -dev do the same thing. Just like npm install, if the -save-dev flag is specified, npm update will update devDependencies as well.

If no packages are specified, npm update will update every (non-dev) dependency listed in package.json. Instead, npm will install the latest version of dep1 that also satisfies semvar (if there is one). This means if the latest version of dep1 is 1.3.0 but your package.json specifies "dep1" : "~1.2.3" you wont get the latest version. Npm update also installs missing packages. Npm update update packages to their latest stable versions.
