paint-brush
Check for npm modules updates easilyby@hendrysadrak
2,228 reads
2,228 reads

Check for npm modules updates easily

by Hendry SadrakMay 17th, 2015
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

If you are a <a href="https://yarnpkg.com" target="_blank">yarn</a> user, running <code class="markup--code markup--p-code">yarn upgrade-interactive</code> is the one built-in command that makes your life super easy. But no, this article is meant for the <em>hardcore</em> <a href="https://hackernoon.com/tagged/npm" target="_blank">npm</a> users.

Company Mentioned

Mention Thumbnail
featured image - Check for npm modules updates easily
Hendry Sadrak HackerNoon profile picture

If you are a yarn user, running yarn upgrade-interactive is the one built-in command that makes your life super easy. But no, this article is meant for the hardcore npm users.

When using npm there is a built-in tool to check for dependencies updates too. npm outdated shows you list of outdated packages.

npm outdated in action

But there is a better tool for that! Using npm-check-updates to check for updates and updating your package.json is a no-brainer.

npm-check-updates is a command-line tool that allows you to upgrade your package.json or bower.json dependencies to the latest versions, regardless of existing version constraints.

Installation

npm install -g npm-check-updates

Usage

$ ncu



nuxt ^1.0.0 → ^2.2.0node-sass ^4.9.2 → ^4.9.4vue-scrollto ^2.11.0 → ^2.13.0

Run with -u to upgrade your package.json

Well, wasn't that easy? It shows which packages have updates and using the flag -u it automatically replaces the version in package.json.

Edited 19 Oct 2018 - Updated the article with new images and up to date information.