Install Node.js
Coding tools like Claude Code, Codex and Gemini CLI need Node.js 18 or later. If you already have it, you can skip this page.
Check your version
Run node -v in your terminal. If it shows v18.x.x or higher, you're all set.
Windows
Option 1: official installer (recommended)
- Download the LTS Windows Installer (.msi) from the Node.js website
- Run it with the default settings
- It adds Node.js to your PATH for you
Option 2: package manager
# Winget (Windows 11 / Windows 10)
winget install OpenJS.NodeJS.LTS
# Chocolatey
choco install nodejs-lts
# Scoop
scoop install nodejs-ltsmacOS
Option 1: Homebrew (recommended)
# Install Homebrew if needed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Node.js
brew install nodeOption 2: official installer
Download the LTS .pkg installer from the Node.js website and run it.
Linux
Ubuntu / Debian
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejsCentOS / RHEL
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo yum install -y nodejsFedora
sudo dnf install -y nodejs npmArch Linux
sudo pacman -S nodejs npmUse nvm (for advanced users)
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.bashrc
# Install and use Node.js LTS
nvm install --lts
nvm use --lts
nvm alias default nodeCheck the install
node --version # Should show v18.x.x or higher
npm --version # Should show npm versionTroubleshooting
"command not found" error
- Restart your terminal
- Check that the Node.js folder is on your PATH
- Restart your computer and try again
Permission errors (macOS / Linux)
If a global npm install fails with a permission error, point npm at a folder in your home directory:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrcNext steps
Now set up a coding tool:
