Set Up Node.js for React on Windows, macOS, and Linux

Install Node.js for React on Windows, macOS, and Linux. Choose the LTS version, verify the install, and use nvm to manage Node versions.

5 min read

To set up Node.js for React, install the current LTS release and confirm it works in a terminal. Node is the runtime that runs your build tool and development server, and npm ships with it to install packages.

The current LTS version is Node.js 24. Vite, the build tool used throughout this React track, requires Node 20.19 or newer, so LTS 24 covers every React project in these guides.

Choose a version

Node.js publishes two release lines you will see on the download page. The LTS line is the stable, long-term support release, and the Current line is the newest with features still settling.

For React work, choose LTS. It is the safest version and what most tutorials assume. If a later project needs an older release, nvm can install that exact version side by side.

Install on Windows

Download the LTS installer from the Node.js website and run it. The wizard installs both node and npm and adds them to your PATH.

Accept the default options. When the installer finishes, open a new terminal so the PATH change takes effect.

Install on macOS

The easiest option is the official LTS installer from the Node.js website. Download the package, open it, and follow the prompts.

If you use Homebrew, you can install with:

bashbash
brew install node@24

Homebrew also prints a note about adding the version to your PATH. Follow that instruction before moving on.

Install on Linux

Use your distribution's package manager. On Debian and Ubuntu based systems, the recommended approach is NodeSource's setup script or nvm, because the default repositories often lag behind LTS.

The most flexible option on any Linux system is nvm:

bashbash
nvm install --lts

This installs the current LTS release and switches your shell to it.

Verify the install

Open a terminal and check both tools:

bashbash
node --version
npm --version

The first command prints a version like v24.19.0, and the second prints the npm version. If either command is not found, restart your terminal or reinstall Node.

Download the LTS installer

Get the LTS build for your operating system from the Node.js website.

Run the installer

Complete the wizard on Windows or macOS, or run your package manager on Linux.

Open a new terminal

Restart the terminal so the PATH change is picked up.

Verify node and npm

Run node --version and npm --version and confirm both print numbers.

What to learn next

With Node installed, create a React app with Vite to put it to work. You can also follow the guide on running an existing React project from GitHub to test the setup on real code.

Rune AI

Rune AI

Key Insights

  • Install the current LTS version of Node.js, which is 24 at the time of writing.
  • Use the official installer on Windows and macOS.
  • Use your package manager or nvm on Linux.
  • Verify with node --version and npm --version.
  • nvm lets you install and switch Node versions per project.
RunePowered by Rune AI

Frequently Asked Questions

Which Node.js version should I install for React?

Install the current LTS release, which is Node.js 24 at the time of writing. Vite, the build tool most React tutorials use, requires Node 20.19 or newer.

How do I check my Node.js version?

Run node --version in a terminal. To check npm, run npm --version. Both should print a version number if the install worked.

What is nvm and do I need it?

nvm is a version manager that lets you install and switch between multiple Node.js versions. It is optional, but useful when different projects need different versions.

Conclusion

Setting up Node.js means installing the current LTS version and confirming node and npm work in a terminal. The official installer is the simplest path, and nvm is a useful addition when you need to switch versions between projects.