Want to learn how to update node js? It really depends on how you installed it in the first place! Let’s look at your options:
Option 1 (recommended) - NVM
The absolutely best way to install node js (and update node js later) is to use the Node Version Manager.
This will work even if you already have Node js installed some other way. You can just open up a terminal and run:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
Note: For any installation help, check out their official README
And then run `nvm install YOUR-VERSION-OF-NODE. For example:
nvm install v15.9.0
And then set it to default by using:
nvm alias default v15.9.0
And you are good to go!
Option 2 - Official Installer
You can head over to the Node js website and grab either the latest LTS (Long Term Support) build or the absolutely latest release. If the version you want to update to is not on there you can view their releases page and if you have a different operating system you can find the download you need on their download page.
If you are looking for how to update node js, I really recommend taking a few minutes out of your day and moving over to the Node Version Manager. That way future updates will be a breeze! But if you need a specific binary version and don’t want to use NVM. Feel free to check out the releases page above!
Written by Jon Kuperman living in Florida taking some time between jobs. You should follow him on Twitter