# Node.js Installation Guide

Claude Code, Gemini CLI, Codex CLI, and several other developer tools require Node.js. Complete this setup before installing those tools.

## Windows

### Option A: official installer (recommended)

1. Open the [Node.js download page](https://nodejs.org/en/download).
2. Download the current LTS installer for Windows.
3. Run the installer and keep the default options unless your environment requires otherwise.

![Node.js Windows installer](https://r2.bozhouai.com/dragoncode/file-20260317105358821.png)

### Option B: Chocolatey

```powershell
choco install nodejs-lts
```

### Option C: Scoop

```powershell
scoop install nodejs-lts
```

## macOS

### Option A: Homebrew

```bash
brew install node
```

### Option B: official installer

Download the macOS LTS installer from the [Node.js download page](https://nodejs.org/en/download).

## Linux

Use your distribution's package manager or a Node.js version manager. The following NodeSource commands are common examples.

Ubuntu or Debian:

```bash
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
```

CentOS or RHEL:

```bash
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo yum install -y nodejs
```

> Review third-party installation scripts before running them in a production or managed environment.

## Verify the installation

Open a new terminal and run:

```bash
node --version
npm --version
```

The installation is successful when both commands print a version number.

## Optional: use the npmmirror registry

If npm downloads are slow or time out from your network, you can switch to the mainland China mirror:

```bash
npm config set registry https://registry.npmmirror.com
```

Verify the setting:

```bash
npm config get registry
```

To restore the official npm registry later:

```bash
npm config set registry https://registry.npmjs.org
```

