How to install NodeJS

May 30, 2022

To make sure that all modern JS tools work correctly, make sure you have the latest NodeJS installed on your local machine.

Installing latest Node in Ubuntu

Ubuntu doesn’t have the last version in the official package repository, so you need to add an extra one first. Just run this command in shell:

$ curl -s | sudo bash

After that you can’t install Node 16 using the standard apt tool:

$ sudo apt install nodejs -y

To make sure it worked, run node with -v flag:

$ node -v

Installing latest Node on Mac

Luckily, MacOS is actually a variation of UNIX so installing NodeJS here is trivial as well. First, make sure you have Homebrew installed – the number one package system for Mac:

$ /bin/bash -c "$(curl -fsSL"

Then run the following in the terminal:

$ brew install node@16

And a few minutes later you will have a working installation of Node 16!

Published by NinaCoder who lives and works in Mexico DF building useful things.