Ubuntu Linux/Mac
The module n
makes version-management easy:
npm install n -g
For the latest stable version:
n stable
For the latest version:
n latest
Debian 10
Upgrade older versions of node and npm on Debian 10 as follows:
sudo su -c 'curl -sL https://deb.nodesource.com/setup_18.x | bash -'
sudo apt-get install nodejs -y
sudo apt update
sudo apt upgrade
sudo npm install -g [email protected]
node --version
npm --version
Note: Replace setup_18
with the latest long-term support release.
Windows
just reinstall node from the .msi in Windows from the node website.