How to install Node.js?

Created Jan 22, 2024Last modified Jan 22, 2024

JavaScript Basics


Using Homebrew

Run the following command:

brew install node

Using NVM(Node Version Manager):

curl -o- | bash

# Or wget
wget -qO- | bash
nvm install node

Linux (Ubuntu/Debian-based):

Using Package Manager:

sudo apt update
sudo apt install nodejs npm

Using NVM(Node Version Manager):

Same as in macOS part.


Using Node.js Installer:

Using Chocolatey (Package Manager for Windows):

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(''))
choco install nodejs

After the installation, you can verify that Node.js is installed by running the following commands in the terminal or command prompt:

node -v
npm -v