Node.js: How to update Node and NPM to the latest versions

You can check to see what versions of Node and NPM you have with these commands: node -v npm -v. For example:

To update NPM, you can do that at the command line with this command:
npm install -g npm

The output should look something like this:

A good way to update Node is to use Chocolatey. To do this first check to see if you have Chocolatey installed on your machine by running this command at the command line: cinst

If it is installed, the next line will say the version number of Chocolatey. For example: Chocolatey v0.10.8

To update Node.js you will need to run an elevated Admin level command line. For example, you could use a regular Command Prompt but choose “Run as administrator”:

Or you could open what I did for this article: “Administrator: Windows PowerShell”.

With Chocolatey installation confirmed, you only need this command to update Node.js:
cinst nodejs

Output will look something like this:

Now check the versions again to confirm they are updated: