How to Check and Install the Current Node.js Version

September 19, 2025 / Tutorial

Node.js is a popular JavaScript runtime used for building fast and scalable applications. Whether you’re starting a new project or maintaining an existing one, it’s important to ensure you’re using the correct version of Node.js.

This article explains how to check the currently installed Node.js version and how to install or update it on different operating systems.

Steps to Check the Current Node.js Version

You can easily check the version of Node.js installed on your system using the command line.

Follow the steps below:

  1. Open the terminal or command prompt.
    • On Windows, press Windows + R, type cmd, and hit Enter.
    • On macOS or Linux, open the Terminal from your applications or use the shortcut Ctrl + Alt + T.
  2. Type the following command and press Enter:
    node -v
    Or
    node –versionYou will see the installed version displayed.Example output:
    v18.17.1

 

How to Install Node.js

The installation process varies depending on your operating system. Below are the steps for Windows, macOS, and Linux.

For Windows Users

  • Visit the official Node.js website: https://nodejs.org
  • Download the Windows installer (choose the LTS version for stability).
  • Run the installer and follow the setup wizard.
  • After installation, open Command Prompt and verify the version:
    node -v

For macOS Users

  • Go to https://nodejs.org and download the macOS installer.
  • Open the downloaded .pkg file and follow the installation steps.
  • After installation, open Terminal and check the version:
    node -v

For Linux (Ubuntu/Debian) Users

  • Open the terminal.
  • Update your package index:
    sudo apt update
  • Install Node.js:
    sudo apt install nodejs
  • (Optional) Install npm (Node Package Manager):
    sudo apt install npm
  • Verify the installation:
    node -v
    npm -v

Optional: Use Node Version Manager (nvm)

If you need to manage multiple versions of Node.js, you can use nvm (Node Version Manager). It allows you to install and switch between different versions easily.

To install nvm and use it, refer to the official GitHub page: https://github.com/nvm-sh/nvm

Checking and installing the correct version of Node.js is a simple but essential task for developers. By following the steps above, you can ensure your development environment is up to date and ready for your next project.

Learn more tutorials about How to Debug Node.js Applications