Node.js Installation Guide
AI coding assistants and command-line tools like Claude Code, OpenClaw, and Codex depend on Node.js and npm (Node Package Manager). Setting up a stable Node.js environment is the first step before configuring your AI development tools.
Recommended Version
We recommend installing Node.js 20 LTS or newer.
1. Check if Node.js is already installed
Open your terminal or command prompt and run the following commands to check if Node.js and npm are already installed:
node -v
npm -vIf these commands return version numbers (e.g., v20.11.0 and 10.2.4), your Node.js environment is ready and you can proceed to configure your clients.
2. Operating System Installation Guides
macOS
If you use Homebrew (recommended for macOS developers), you can install Node.js directly from your terminal:
# Install Node.js
brew install node
# Verify installation
node -v
npm -vIf you don't use Homebrew, download the official macOS installer (.pkg) from the Node.js Official Website.
Windows
- Download the Windows Installer (
.msi) for the LTS version from the Node.js Official Website. - Run the installer and keep all default settings to ensure
npmand required environment variables are set up. - Open a new PowerShell or Command Prompt window and verify the installation:powershell
node -v npm -v
Linux (Ubuntu / Debian)
For standard package managers on Ubuntu or Debian:
sudo apt update
sudo apt install -y nodejs npm
# Verify installation
node -v
npm -vVersion Manager (Recommended)
For production environments or multi-project development, we recommend using a version manager like nvm or fnm to manage multiple Node.js versions without needing root permissions (sudo).
3. Troubleshooting Common Issues
npm: command not found: The installation might not have finished successfully, or you need to restart your terminal window to apply path changes.permission denied(EACCES): Avoid usingsudo npm install -gas it can corrupt system permissions. Instead, use a version manager likenvmor configure npm to write to a user-owned directory.- Old version shown after updating: Restart your terminal, or check your system's
PATHvariable to ensure the new installation path takes precedence.
