Node.js Installation Guide

Claude Code, Gemini CLI, Codex and other tools require Node.js. Please complete this step first.

Windows

  • Option 1: Official Download (Recommended)
    Go to Node.js website and download the LTS version. Run the installer and follow the prompts.

  • Option 2: Using Chocolatey

    choco install nodejs-lts
    
  • Option 3: Using Scoop

    scoop install nodejs-lts
    

macOS

  • Option 1: Using Homebrew (Recommended)

    brew install node
    
  • Option 2: Official Download
    Go to Node.js website and download the macOS installer.

Linux

  • Ubuntu / Debian

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

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

Verify Installation

node --version
npm --version

Both commands should output a version number.

Switch npm Registry (for users in China)

If installing packages is slow or times out, switch to a domestic mirror:

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

Verify:

npm config get registry

Output should be https://registry.npmmirror.com.