How to Upgrade (or Downgrade) Node.js using NPM

Need to update your version of Node.js? Here's how you can upgrade or downgrade from the command line using NPM.

Upgrading to the latest stable version

This will update you to the latest available stable version:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

Upgrading to the latest LTS version

Node also offers a long-term support (LTS) version. If you need that version (or any other), simply specify the version number you want:

sudo npm cache clean -f
sudo npm install -g n
sudo n 4.4.2

Checking your Node version

To see which version of Node is currently installed, simply run:

node -v

The version number displayed is the one that's currently active on your machine.

Simple, Beautiful Publishing

This website is powered by Postleaf, an open source blogging platform I built myself. Check it out if you’re looking for a fresh, modern approach to content management.

Author avatar

About the author

Cory LaViska is a founder, web developer, and bootstrapper based in Orlando, Florida. Need to get in touch? You can connect with him on Twitter. Looking for a simple, no-worry CMS for your clients? Try my Surreal CMS!