Skip to content

Node.js Setup

chro requires Node.js 18 or later as a prerequisite for running AI coding tools like Claude Code and OpenAI Codex.

First, check if Node.js is already installed:

Terminal window
node -v
npm -v

If both commands return version numbers (Node.js 18+), you’re ready to proceed. Otherwise, follow the installation instructions below.


Homebrew is the most popular package manager for macOS.

1. Install Homebrew (if not already installed):

Terminal window
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. Install Node.js:

Terminal window
brew install node@22

3. Verify installation:

Terminal window
node -v # Should show v22.x.x
npm -v # Should show 10.x.x or later

fnm allows you to manage multiple Node.js versions easily.

1. Install fnm via Homebrew:

Terminal window
brew install fnm

2. Add fnm to your shell (add to ~/.zshrc or ~/.bashrc):

Terminal window
eval "$(fnm env --use-on-cd)"

3. Restart your terminal or run:

Terminal window
source ~/.zshrc # or source ~/.bashrc

4. Install and use Node.js 22:

Terminal window
fnm install 22
fnm use 22
fnm default 22

Download the macOS installer from the official Node.js website.

  1. Download the LTS version (recommended) or Current version
  2. Open the .pkg file and follow the installation wizard
  3. Restart your terminal after installation

winget is the official Windows Package Manager, pre-installed on Windows 11 and available for Windows 10.

1. Open PowerShell or Terminal

2. Install Node.js:

Terminal window
winget install OpenJS.NodeJS.LTS

Note: If prompted by UAC (User Account Control), click “Yes” to allow the installation.

3. Restart your terminal (important!)

4. Verify installation:

Terminal window
node -v
npm -v

Download the Windows installer from the official Node.js website.

  1. Download the LTS version .msi installer
  2. Run the installer and follow the wizard
  3. Ensure “Add to PATH” is checked during installation
  4. Restart your terminal after installation

nvm-windows lets you manage multiple Node.js versions on Windows.

1. Download nvm-windows:

Download the latest installer from the releases page.

2. Install nvm-windows:

Run the installer and follow the prompts.

3. Install and use Node.js:

Terminal window
nvm install 22
nvm use 22

After installation, verify everything is working:

Terminal window
# Check Node.js version (should be 18+)
node -v
# Check npm version
npm -v
# Test npm by checking global packages location
npm root -g

”command not found: node” (macOS/Linux)

Section titled “”command not found: node” (macOS/Linux)”
  • Ensure Node.js is in your PATH
  • Restart your terminal
  • If using fnm, make sure you’ve added the eval line to your shell config
  • Restart your terminal/PowerShell
  • Check if Node.js is in your system PATH:
    • Open System Properties > Advanced > Environment Variables
    • Look for Node.js in the Path variable

If you see EACCES permission errors when installing global packages:

Terminal window
# Create a directory for global packages
mkdir ~/.npm-global
# Configure npm to use it
npm config set prefix '~/.npm-global'
# Add to PATH in ~/.zshrc or ~/.bashrc
export PATH=~/.npm-global/bin:$PATH

If you’re behind a corporate proxy:

Terminal window
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

Once Node.js is installed, proceed to: