Get Node.js running on Windows, Mac, or Linux in five minutes

Node.js is a runtime that lets you run JavaScript outside a web browser — on your computer, a server, or in the cloud. To use it, you need to download the installer from the official Node.js website, run it, and follow the setup steps. The whole process takes about five minutes and requires no coding knowledge.

This guide walks you through downloading Node.js, installing it, and checking that it worked. We cover Windows, Mac, and Linux separately because each has slightly different steps.

Key Takeaways

  • Download Node.js from nodejs.org, not from other websites, to avoid fake or outdated versions.
  • Choose the LTS (Long Term Support) version unless you have a specific reason to use the Current version.
  • Windows and Mac users run an installer file; Linux users typically use a package manager or download a binary.
  • After installation, open a terminal or command prompt and type node --version to confirm it worked.
  • npm (Node Package Manager) installs automatically with Node.js and lets you download code libraries others have written.

Download Node.js for Windows

Go to nodejs.org in your web browser. You will see two large download buttons near the top of the page. Click the one labeled LTS (Long Term Support). This is the stable version that most people should use. The file will be named something like node-v20.10.0-x64.msi and will download to your Downloads folder.

Once the download finishes, open your Downloads folder and double-click the .msi file. A window will open asking you to accept the license agreement. Click the checkbox next to "I accept the terms in the License Agreement" and then click Next. On the next screen, you can leave the installation folder as the default (usually C:\Program Files\nodejs) and click Next again.

The installer will ask which features to install. Leave all boxes checked — this includes npm, which you will need to download code libraries. Click Next, then Install. Windows may ask for permission to make changes to your computer; click Yes. When the installation finishes, click Finish.

Download Node.js for Mac

Go to nodejs.org and click the LTS download button. The file will be named something like node-v20.10.0.pkg. Once it downloads, open your Downloads folder and double-click the .pkg file. A window will open asking you to install Node.js.

Click Continue to read the license, then click Agree to accept it. On the next screen, click Install. Your Mac will ask for your password (the one you use to log in). Type it and click Install Software. The installation takes about a minute. When it finishes, click Close.

If you use Homebrew (a package manager for Mac), you can also install Node.js by opening Terminal and typing brew install node. This method is faster if you already have Homebrew set up, but the .pkg installer works just as well if you do not.

Download Node.js for Linux

Linux installation depends on which distribution you use. The easiest method is through your package manager. Open a terminal and run one of these commands based on your system:

  • Ubuntu or Debian: sudo apt update then sudo apt install nodejs npm
  • Fedora: sudo dnf install nodejs npm
  • Arch: sudo pacman -S nodejs npm

If your distribution is not listed or you prefer to install manually, go to nodejs.org, click LTS, and look for the Linux Binaries link. Download the file that matches your system (usually x64 for most computers). Extract the folder, then add it to your system path so you can run Node.js from any terminal window. Instructions for this step vary by distribution, so search for "[your distribution name] add to PATH" if you need help.

Verify the installation worked

After installation finishes on any operating system, open a terminal or command prompt to check that Node.js is working. On Windows, press the Windows key and type cmd, then press Enter. On Mac or Linux, open Terminal (search for it in your applications or press Ctrl+Alt+T on Linux).

In the terminal window, type node --version and press Enter. You should see a version number like v20.10.0. If you see this, Node.js installed correctly. Next, type npm --version and press Enter. You should see a version number for npm as well, usually something like 10.2.3.

If you see "command not found" or "is not recognized" instead of a version number, the installation did not work. On Windows, restart your computer and try again — sometimes the system needs to refresh its list of installed programs. On Mac or Linux, check that you followed all the steps above and that the installer reported success.

What to do after installation

Now that Node.js is installed, you can start writing JavaScript code that runs on your computer instead of in a browser. Create a new folder for your project, open a text editor (Notepad on Windows, TextEdit on Mac, or any code editor), and write a simple JavaScript file. Save it with a .js extension, like hello.js.

Open a terminal, navigate to the folder where you saved the file, and type node hello.js to run it. This is the basic workflow: write code, save it, run it with Node.js. As you build more complex projects, you will use npm to download libraries that other developers have written, which saves you from writing everything from scratch.

Choosing between LTS and Current versions

Node.js offers two versions: LTS (Long Term Support) and Current. LTS versions receive security updates for several years and are stable — they do not change much. Current versions have the newest features but change more often and receive updates for only a few months. For learning and most projects, download the LTS version. Use Current only if you need a specific new feature that is not yet in LTS.

You can have both versions installed at the same time if you need to, though most people never do. When you visit nodejs.org, the page clearly labels which version is LTS and which is Current, so you will know which button to click.

Frequently Asked Questions

Do I need to uninstall an old version of Node.js before installing a new one?

No, you can install a newer version directly over an old one on Windows and Mac — the installer will replace the old files. On Linux, your package manager handles this automatically. If you want to keep both versions, you can use a version manager like nvm (Node Version Manager), but that is not necessary for most people starting out.

What is npm and why does it install with Node.js?

npm is Node Package Manager, a tool that downloads and manages code libraries written by other developers. When you install Node.js, npm comes with it automatically. You use npm from the terminal to add libraries to your projects, which saves you from writing everything yourself. For example, typing npm install express downloads a popular web framework.

Can I run Node.js on a Chromebook or tablet?

Not directly. Node.js is designed for Windows, Mac, and Linux computers. On a Chromebook, you can enable Linux support and install Node.js in the Linux environment, but this requires some extra setup. On tablets and phones, you would need to use a cloud-based coding environment or a remote server instead.

Is Node.js safe to download from nodejs.org?

Yes, nodejs.org is the official website and is safe. Never download Node.js from other websites — fake versions exist that contain malware. Always go directly to nodejs.org and download from the main download buttons on the homepage.

What if the installation fails or I get an error?

On Windows, restart your computer and try again — sometimes Windows needs to refresh. On Mac, make sure you have enough disk space and that you entered your password correctly. On Linux, check that you have permission to install software (you may need to use sudo). If problems continue, search for the exact error message you see — it usually points to the solution.