Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Node.js and Check the Node.js Version

Install Node.js on Windows, macOS or Linux, and see which version you have.

How-To Guides2 min read7 steps12 screenshots

What Node.js is

Node.js is an open-source, cross-platform runtime that runs JavaScript outside the browser. It uses the V8 engine of Chrome. With Node.js you can write the back end of an app in the same language as the front end. It is event-driven and non-blocking, so it is fast for network apps.

Windows

  1. Open the official Node.js download page and download the Windows installer (the .msi file). Choose the LTS version for a stable release.
    The Node.js download page for Windows
  2. Run the installer and accept the license. Keep the default settings.
    The Node.js installer
  3. Restart the computer if you need to.
  4. Open Command Prompt and check:
node -v
npm -v
Node.js version in Command Prompt

macOS

  1. Download the macOS installer (.pkg) from the Node.js website.
    The Node.js download page for macOS
  2. Open the file and follow the steps.
    The macOS installer
  3. Open Terminal and check:
node -v
npm -v
Node.js version on macOS

You can also install it with Homebrew: brew install node.

Linux

Ubuntu and Debian

sudo apt update
sudo apt install nodejs npm
Installing Node.js on Linux
The installation output

Check the version:

node -v
npm -v
Node.js version on Linux

The version in the distribution repository can be old. To get a newer one, use the NodeSource repository. For example, for Node.js 20:

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
Adding the NodeSource repository
Installing Node.js 20

Or use nvm, which lets you switch between versions:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install --lts
nvm ls
Managing Node.js versions with nvm

Check the version at any time

node --version

Quick recap

  • Use the installer on Windows and macOS, or apt / NodeSource / nvm on Linux.
  • Check with node -v and npm -v.
  • Pick an LTS version for production.