APIshop Documentation

Install Node.js on macOS

Essential Runtime Environments for the Three Major AI Coding Tools

💡 Important Note

Claude Code, CodeX, and Gemini CLI all require Node.js 18+ to run. If you have already installed Node.js 18 or later, you can skip this section. Verification command: node -v

# Install Homebrew (if it is not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Node.js
brew install node

# Verify installation
node --version
npm --version

Method 2: Official Installation Package

  1. Visit the Node.js official website: https://nodejs.org
  2. Download the LTS .pkg installer
  3. Run the installer and follow the prompts to complete the installation

Verify installation

Open a terminal and run:

node --version
npm --version

If a version number is displayed (such as v18.x.x or later), the installation was successful.

Frequently Asked Questions

Slow Homebrew Installation

You can use a domestic mirror:

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"

Permission issues

If you run into permission issues, do not use sudo; instead, fix your Homebrew permissions:

sudo chown -R $(whoami) /usr/local/bin /usr/local/lib

Next steps

✅ Environment setup complete!

You can now continue installing Claude Code, CodeX, or Gemini CLI.