Skip to content

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:

bash
node -v
npm -v

If 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:

bash
# Install Node.js
brew install node

# Verify installation
node -v
npm -v

If you don't use Homebrew, download the official macOS installer (.pkg) from the Node.js Official Website.

Windows

  1. Download the Windows Installer (.msi) for the LTS version from the Node.js Official Website.
  2. Run the installer and keep all default settings to ensure npm and required environment variables are set up.
  3. 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:

bash
sudo apt update
sudo apt install -y nodejs npm

# Verify installation
node -v
npm -v

Version 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 using sudo npm install -g as it can corrupt system permissions. Instead, use a version manager like nvm or configure npm to write to a user-owned directory.
  • Old version shown after updating: Restart your terminal, or check your system's PATH variable to ensure the new installation path takes precedence.

Unified AI API Gateway — Access 200+ models through one endpoint.