Upgrading Node.js using npm

The Node.js ecosystem provides a tool to update Node from within npm called, simply, “n”.

Install n thus:

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

I don’t know that clearing the cache is actually necessary, but a number of people have recommended doing so.

Update to the latest version of node using:

sudo n stable

n allows node versions to be changed easily. The n package listing has details.

This entry was posted in Programming and tagged , , , . Bookmark the permalink.

Leave a Reply