Installing Node.js: Windows, macOS and Linux
A step-by-step guide to installing Node.js with the official installer or nvm, switching versions and verifying the installation on three operating systems.

For a Node.js installation, just download the LTS version from nodejs.org and run the installer. If you will use different versions across several projects, install with nvm on macOS and Linux or nvm-windows on Windows. Then check the version in the terminal with the node -v and npm -v commands; if both return a version number, the installation is complete.
What Is Node.js and Why Install It?
Node.js is a runtime environment that runs JavaScript outside the browser, directly on your computer or on a server. Almost all modern web projects need Node.js during development: installing packages, building and opening a local development server are all done with it.
Even if you do not use tools such as React, Vite, Next.js or Tailwind, the first step you meet when you want to run a project on your computer is usually npm install. This command belongs to npm, the package manager that comes with Node.js; in other words, you cannot get past this step without installing Node.js.
In this guide we cover two ways: the official installer for those who will work with a single version, and a version manager for those who juggle several projects. The table below makes the choice clear.
| Method | Who it is for | Pros | Cons |
|---|---|---|---|
| Official installer (.msi / .pkg) | Beginners, single project | Easiest way, a few clicks | Switching versions is a hassle |
| nvm / nvm-windows | Multiple projects, teamwork | Switch between versions with one command | Initial setup is a bit more technical |
| Package manager (brew, apt, winget) | Users who like the terminal | Install and update by command | The repository version may be outdated |
What You Need Before Installing
Node.js is a lightweight install, but a few preparations prevent problems later. In particular, if an older Node.js was installed on your computer earlier, installing nvm without removing it can cause a PATH conflict.
Also pay attention to processor architecture. On Apple Silicon (M series) Macs and ARM-based Windows devices the installer usually picks the right architecture itself; if you download manually, do not mix up x64 and ARM64 files. The wrong architecture may run but slowly, or some native packages may fail to build.
On corporate computers, a proxy or firewall can block npm from downloading packages. If you are on such a network, ask your IT team for access to the npm registry address (registry.npmjs.org) before installing.
- Administrator rights: needed for the official installer on Windows and macOS; nvm is installed into the user folder, so it usually does not need them.
- Terminal: PowerShell or Windows Terminal on Windows, Terminal on macOS, and the default shell on Linux are enough.
- Removing the old installation: If you will switch to a version manager, first remove the existing Node.js via Settings > Apps or your package manager.
- Version choice: For production and for learning, choose the LTS (long-term support) version; the Current release is for those who want to see new features early.
Installing Node.js on Windows
There are three ways on Windows: the official .msi installer, Windows' own package manager winget, and nvm-windows for version management. Whichever you choose, close and reopen any open terminals after installing; otherwise the new PATH setting will not be visible.
With the official installer
Download the Windows LTS .msi file from nodejs.org, run the installer and proceed with the default options. The installer sets up npm together with Node.js and adds it to PATH automatically.
With winget
With winget, which ships with Windows 10 and 11, you can install the LTS version with a single command:
winget install OpenJS.NodeJS.LTSWith nvm-windows
If you need several versions, install nvm-windows; it is a separate project from nvm on macOS/Linux, but its commands are similar. After installing, open PowerShell as administrator and run the following commands:
winget install CoreyButler.NVMforWindows
# Close and reopen the terminal
nvm install lts
nvm use lts
nvm listInstalling with nvm on macOS and Linux
On macOS and Linux, the healthiest way is to use nvm (Node Version Manager). nvm installs Node.js into your user folder, so you do not need sudo when installing global packages and you avoid permission errors.
The command below downloads and runs nvm's install script. The official README suggests a version-tagged address; the safest approach is to copy the most up-to-date command from the nvm GitHub page.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
# Reload the shell (pick one depending on the shell you use)
source ~/.bashrc
source ~/.zshrc
# Check that nvm is installed
command -v nvmnvm install --lts
nvm use --lts
nvm alias default 'lts/*'Installing on macOS with Homebrew
If you use Homebrew, the brew install node command also works. However, this command usually installs the newest version; if you want to stay on LTS, nvm is more flexible.
brew install nodeLinux distribution repositories
On Ubuntu or Debian, the sudo apt install nodejs npm command works, but the version in the repository is often older than what current projects require. That is why we recommend nvm on development machines.
How Do I Verify the Installation?
When the installation finishes, open a new terminal and run the commands below. Both should return a version number. Then see that Node.js runs code with a small test script.
- The output of node -v is a version number starting with v.
- npm -v returns digits only; npm comes with Node.js.
- If the test command prints the message, your environment is ready; next up is package management with npm commands.
node -v
npm -v
node -e "console.log('Node.js is working')"How to Switch Node Versions
Different projects may require different Node.js versions: an old project runs on an old version, a new one on the current LTS. Switching Node versions takes a few seconds with nvm.
If you put an .nvmrc file in the project's root folder, everyone on the team uses the same version. Entering the folder and typing nvm use is enough to switch to the version in the file (nvm-windows does not read .nvmrc; there you type the version by hand).
# Installed versions
nvm ls
# LTS versions on the remote server
nvm ls-remote --lts
# Install and switch to a specific major version (example)
nvm install 20
nvm use 20
# Save the version used in the project
node -v > .nvmrc
nvm useCommon Errors and Fixes
Most Node.js installation problems involve PATH and permissions. The list below summarizes the errors we see most often and their quick fixes.
node command not recognized
On Windows, the "node is not recognized" error usually appears because the terminal was opened before installation. Close and reopen all terminals and VS Code; if the problem persists, check whether the Node.js folder is in the PATH variable.
PowerShell script block
PowerShell may refuse to run the npm.ps1 file. Relaxing the execution policy for your own user only fixes the problem:
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedEACCES permission error
If you get an EACCES error during npm install -g on macOS or Linux, Node.js was installed into a system folder. Do not run npm with sudo; remove the existing installation and reinstall with nvm.
nvm: command not found
The install script adds the nvm lines to your shell profile, but an already open terminal does not know about it. Run source ~/.zshrc or source ~/.bashrc, or reopen the terminal.
What to Do After Installation
Once Node.js is ready, complete the rest of your development environment: see our guides on VS Code installation for an editor and uploading a project to GitHub for backing up and sharing your code. All step-by-step guides are in the setup guides category.
If you are developing a web project for a business, Node.js-based tools contribute directly to page speed by minifying images, CSS and JavaScript at build time. We cover this topic in detail in our speed and performance optimization service.
If you do not have your own team, or your project needs a comprehensive system such as an e-commerce platform, leaving setup and development to an expert team saves time. In corporate website and e-commerce platform projects we set up the whole environment, and you focus only on content.
Frequently Asked Questions
01Should I install LTS or Current?
Choose LTS for learning, business projects and servers; it receives security updates for a long time. The Current release suits those who want to try new features early, and its support period is shorter.
02Do I need to install npm separately?
No. The official installer, nvm and nvm-windows install npm together with Node.js. If you want to update npm, you can use the npm install -g npm command.
03How do I completely remove Node.js from my computer?
On Windows, uninstall it from Settings > Apps and delete the npm and npm-cache folders in your user folder. If you installed with nvm, you can remove versions one by one with the nvm uninstall command.
04Should I use nvm on a server too?
On single-user development servers, nvm is practical. On production servers, repeatable methods such as the distribution's official or Node.js's recommended package repository, or a Docker image, are easier to manage.
Installing Node.js correctly keeps all later development steps running smoothly: the LTS version, flexible version management with nvm and a verification command are enough. If you are looking for custom software or a web design solution for your business instead of building your project from scratch, explore Aurora Yazılım's custom software solutions or get in touch with us.


