The easiest way to update nodejs and npm

Linux:

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

Windows:

Methode 1:
1. Dowload and install the latest version of node.js
2. go the directory: C:\Program Files\nodejs
npm install -g npm@latest

Methode 2:
1. install chocolatey:
2. choco install nodejs (install node.js)
choco update nodejs (update node.js)
choco update npm

Methode 3:

Download the latest MSI from here, and run it

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.