


Note: the last one is no different than doing uninstall followed by install like this: npm uninstall browser-sync -save-dev

or the latest and greatest by doing: npm install -save-dev or the latest 2.1.x by doing: npm install -save-dev You can install/save the latest 2.x.x by doing: npm install -save-dev In your case, it looks like you want the next major version (v2.x.x), which is likely to have breaking changes and you will need to update your app to accommodate those changes. Use npm update|yarn upgrade (without a package name) to update all modules.Use npm|yarn outdated to see which modules have newer versions.Hopefully, you've found this post useful and enjoyed reading it.Most of the time you can just npm update (or pnpm update or yarn upgrade) a module to get the latest non breaking changes (respecting the semver specified in your package.json) (<- read that last part again). In this post, we've seen how we can use npm and yarn to update Node packages to the latest, a specific version, and the latest stable. Here's how that is done in yarn: yarn upgrade express -latest Conclusion Here's how to use the suffix to update express to the latest stable version: npm update Lastly, you can also update a specific package to the latest stable version by adding the suffix to the package name. Here's how to do this in yarn: yarn upgrade Updating a Specific Package to Latest Stable Here's how to update express to version 4.0: npm update

This done by adding the version number to the package name. If for some reason you don't want the latest version, perhaps because it may introduce breaking changes to your code, you can alternatively specify a specific version. You can do this in yarn by using the yarn upgrade command: yarn upgrade express Update a Specific Package to Specific Version This command takes a package name as an argument and updates it to the latest version.įor example, here is how to update just express: npm update express To update a specific Node package, you can use the npm update command. Sometimes, you need to update a specific Node package, for example if it recently fixed a bug that you need. In this post, we'll learn how to use NPM to update a specific Node package. Updating a Specific Package to Latest Stable.Update a Specific Package to Specific Version.
