If youâre looking for how to install Node.js initially, check out my post How to Install Node.js On Linux, Windows, Mac OSX.
This is pretty cool; you can upgrade Node.js with the power of itâs intuitive package manager, npm and the Node.js version manager, n.
You can check your current version of Node by typing:
node -v
Hereâs what you need to enter in your terminal:
Optional: Clear your npm cache (this is a âprobably not necessary but could be usefulâ step):
sudo npm cache clean -f
Install ânâ (ânâ allows you to manage npm versions)
sudo npm install -g n
Install the latest stable version by typing:
sudo n stable
Install a specific version, for example v0.8.11:
sudo n 0.8.11
Bonus tips:
npm list -g --depth 0
list global packages
npm-check-updates
upgrades your package.json dependencies to the latest versions, ignoring specified versions
ncu -g ncu is another way to access npm-check-updates, -g checks all your global packages