Node.js Installation
Install the Node.js runtime environment to prepare for AI coding tools like Claude Code, Codex CLI, and OpenCode.
Claude Code, Codex CLI, OpenCode, and other AI coding tools all require Node.js to run. If you haven't installed it yet, complete this step before continuing.
Windows
Option 1: Official Installer (Recommended)
- Visit nodejs.org and download the LTS version


- Double-click the installer and follow the prompts


The installer will ask whether to install additional build tools (such as Python, Visual Studio Build Tools). Press any key to continue — these tools are needed when using npm to install native modules.
- Restart your terminal after installation
macOS
Option 1: Homebrew (Recommended)
brew install node
If you don't have Homebrew installed, run this first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Option 2: Official Installer
Visit nodejs.org and download the macOS LTS installer, then double-click to install.

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 nodejsVerify Installation
After installation, run the following commands to confirm Node.js and npm are working properly:
node --version
npm --versionBoth commands should output version numbers. Node.js 20 or higher is recommended (Node.js 20 is the current LTS version).

npm Registry Acceleration (China Users)
If npm downloads are slow from within China, you can switch to the npmmirror registry (maintained by Alibaba Cloud) to speed things up.
Switch command:
npm config set registry https://registry.npmmirror.comVerify the switch:
npm config get registryTo revert to the official registry:
npm config set registry https://registry.npmjs.orgCommon Issue: Windows PowerShell Execution Policy Error

This is a very common error in Windows PowerShell. It occurs because Windows' default security policy (execution policy) prohibits running scripts, preventing the npm.ps1 script file from executing.
Here's how to resolve this issue permanently:
Solution: Modify PowerShell Execution Policy
You can allow local scripts to run by modifying the current user's execution policy. This is completely safe and permanently solves issues with running npm and other Node.js global modules.
1. Run PowerShell as Administrator
While modifying current user permissions sometimes doesn't require admin rights, to ensure success:
- Right-click the Start menu (or press
Win + X). - Select Windows PowerShell (Admin) or Terminal (Admin).
2. Enter and execute the following command
Copy and paste the following code into PowerShell, then press Enter:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser3. Confirm the change
The system will display a lengthy prompt about the execution policy change and ask whether you want to proceed.
- Type
YorA, then press Enter to confirm.
4. Verify it worked
Re-enter your previous command to test:
npm --version
If it successfully outputs the npm version number (e.g., 10.x.x), the error is resolved!

Next Steps
Once Node.js is installed, you can set up the following AI coding tools:
- Claude Code — terminal-based AI coding assistant
- Codex CLI — OpenAI's terminal coding agent
- OpenCode — open-source terminal AI coding assistant
- Cursor — AI code editor built on VS Code, with a Chat Completions API reference for OpenAI-compatible clients