A Step-by-Step Guide to Installing Node.js on Windows 11

Install Node.js on Windows 11 easily with our step-by-step guide. Covers both the official LTS installer method and using NVM for Windows to manage multiple Node versions for development.

A Step-by-Step Guide to Installing Node.js on Windows 11

Node.js is a powerful JavaScript runtime environment that allows developers to run JavaScript code outside of a web browser. It's widely used for building fast, scalable network applications, command-line tools, and backend services. Think of it as a way to use JavaScript, a language traditionally for web browsers, to build all sorts of software on your computer.

Installing Node.js on Windows 11 is straightforward and essential for anyone looking to develop web applications, APIs, or use various JavaScript-based tools. This guide provides detailed steps to install Node.js on your Windows 11 computer using two common methods: the official installer and Node Version Manager (NVM) for Windows.

System Requirements (Prerequisites)

Before starting the installation, please verify that your computer meets these requirements:

  • Windows 11 Operating System: A 64-bit version of Windows 11 (Home, Pro, Enterprise, or Education). While Node.js might work on older versions, this guide specifically targets Windows 11.
  • Administrator Privileges: You will need administrator rights on your computer to run the installer or certain commands.

This is the simplest method and suitable for users who need one stable version of Node.js.

Step 1: Download the Node.js Installer

  1. Open your web browser and navigate to the official Node.js website: https://nodejs.org/
  2. On the homepage, you will typically see two download options:
    • LTS (Long Term Support): Recommended for most users. It provides stability and is supported for a longer period.
    • Current: Contains the latest features but might be less stable. Generally used by developers who need cutting-edge features.
  3. Click the LTS button to download the Windows Installer (.msi file).

Step 2: Run the Installer

  1. Locate the downloaded .msi file (e.g., node-vXX.XX.X-x64.msi) in your Downloads folder and double-click it to launch the installation wizard.
  2. Click Next on the welcome screen.
  3. Read and accept the license agreement, then click Next.
  4. Choose the destination folder where Node.js will be installed. The default location (C:\Program Files\nodejs\) is usually fine. Click Next.
  5. On the "Custom Setup" screen, ensure all components, especially "npm package manager" and "Add to PATH", are selected. Click Next.
  6. An optional screen may ask if you want to automatically install necessary tools like Chocolatey and Python. This can be helpful for compiling native addons. You can check this box if you anticipate needing these tools, or leave it unchecked if you prefer to install them manually later. Click Next.
  7. Click Install to begin the installation process. You might be prompted by User Account Control (UAC) to allow the installer to make changes; click Yes.
  8. Once the installation is complete, click Finish. If you checked the box in step 6, a PowerShell window might open to install additional tools; let it complete.

Step 3: Verify the Installation

To ensure Node.js and npm (Node Package Manager, which is included with Node.js) were installed correctly:

  1. Open Command Prompt or Windows PowerShell. You can do this by clicking the Start button, typing cmd or powershell, and selecting the application.

Type the next command and press Enter:

npm -v

This should output the installed npm version (e.g., 9.6.7).

Type the following command and press Enter:

node -v

This should output the installed Node.js version (e.g., v18.17.1).

If both commands display version numbers, Node.js is successfully installed and ready to use.

Node Version Manager (NVM) allows you to install and manage multiple versions of Node.js on the same machine. This is very useful if you work on different projects requiring different Node.js versions.

Note: If you previously installed Node.js using the official installer, it's recommended to uninstall it before installing NVM for Windows to avoid conflicts.

Step 1: Install NVM for Windows

  1. Go to the NVM for Windows releases page on GitHub: https://github.com/coreybutler/nvm-windows/releases
  2. Scroll down to the "Assets" section of the latest release.
  3. Download the nvm-setup.zip file.
  4. Extract the contents of the zip file.
  5. Run the nvm-setup.exe installer.
  6. Follow the installation wizard steps, accepting the license agreement and choosing the installation directories for NVM and the Node.js symlink. Default locations are usually suitable.
  7. Click Install and complete the installation.

Step 2: Install Node.js using NVM

  1. Open a new Command Prompt or PowerShell window as Administrator. (Right-click the icon and select "Run as administrator"). This is important for NVM to have the necessary permissions.

To install a specific version (e.g., version 18.17.1), run:

nvm install 18.17.1

NVM will download and install the specified version.

To install the latest LTS version of Node.js, run:

nvm install lts

Step 3: Select the Node.js Version to Use

After installing one or more versions, you need to tell NVM which version to use. Run the following command, replacing <version> with the version number you want to activate (e.g., 18.17.1 or the version number shown after nvm install lts):

nvm use <version>

For example:

nvm use 18.17.1

You should see a confirmation message like Now using node v18.17.1 (64-bit).

Step 4: Verify the Installation

  1. In the same Administrator Command Prompt or PowerShell window, verify the installation:

You can see all installed Node.js versions by running:

nvm list

The currently active version will have an asterisk (*) next to it.

Check the npm version:

npm -v

Check the active Node.js version:

node -v

If the node -v and npm -v commands show the version you selected with nvm use, then NVM and Node.js are correctly set up.

Installation Complete

You have now successfully installed Node.js on your Windows 11 computer using either the official installer or NVM for Windows. You are ready to start building applications, running scripts, and utilizing the vast ecosystem of npm packages.

Further Reading & References

For more detailed information, you may find these official resources helpful: