Update Node Using a Package Manager

Watch out! This tutorial is over 2 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.
Tutorial Difficulty Level    

Node package manager, or npm, helps you discover, share, and use code, along with managing dependencies.

Node comes with npm pre-installed, but the manager is updated more frequently than Node. Run npm v to see which version you have, then npm install npm@latest g to install the newest npm update. Run npm v again if you want to make sure npm updated correctly.

To update Node, you’ll need npm’s handy n module. Run this code to clear npm’s cache, install n, and install the latest stable version of Node:

To install the latest release, use n latest. Alternatively, you can run n #.#.# to get a specific Node version.

Check your new node version with