Node.js beginner 15 min

Installing Node.js

Learn about Installing Node.js in Node.js.

Installing Node.js

Node.js is a JavaScript runtime that lets you run JavaScript outside the browser. Before you can build backend applications, you need to install Node.js on your computer.

Installing on Windows

  1. Open your browser and go to nodejs.org.
  2. Click the green LTS (Long Term Support) button to download the installer. LTS is the stable version recommended for beginners.
  3. Run the downloaded .msi file.
  4. Click Next through the setup wizard. Keep the default options selected.
  5. When you reach the Tools for Native Modules screen, you can leave it unchecked.
  6. Click Install and wait for the installation to finish.
  7. Restart your terminal or command prompt.

Installing on Linux (Ubuntu / Debian)

  1. Open a terminal.
  2. Update your package list:
    sudo apt update
  3. Install curl and software-properties-common:
    sudo apt install -y curl software-properties-common
  4. Download and run the NodeSource setup script for the LTS version:
    curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
  5. Install Node.js:
    sudo apt install -y nodejs
  6. Verify the installation with:
    node -v
    and
    npm -v

Installing on Linux (Fedora / RHEL)

  1. Open a terminal.
  2. Install Node.js and npm:
    sudo dnf install -y nodejs npm
  3. Verify the installation with:
    node -v
    and
    npm -v

Verify Installation

Open your terminal and run:

node -v
npm -v

If you see version numbers, Node.js and npm are installed correctly.

Practice

Install Node.js on your computer and run the node -v command. Share the version number you see.