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