

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. The next step in the process involves using the migrate CLI in order to apply the migrations that were generated in migrations.json in the previous step.Įach Nx plugin is able to provide a set of migrations which are relevant to particular versions of the package, and so migrations.json will only contain migrations which are appropriate for the update you are currently applying.Npm update update packages to their latest stable versions. npm install, yarn, or pnpm install) but in the next step nx migrate -run-migrations will also run this automatically for you. Inspect the changesĪt this stage, after inspecting the package.json, you may wish to manually run the appropriate install command for your workspace (e.g. Feel free to manually apply the desired adjustments. Sometimes the migration can update a package to a version that is either not allowed or conflicts with another package. Now, you can inspect package.json to see if the changes make sense.
