Installing Claude Code
Claude Code is a terminal-based AI coding assistant made by Anthropic. It requires Node.js (a software platform) to run.
Step 1: Install Node.js
Windows:
- Go to https://nodejs.org/
- Download the LTS (Long Term Support) version
- Open the downloaded file and follow the installer prompts
- Accept all default settings
Mac:
- Go to https://nodejs.org/
- Download the LTS version
- Open the downloaded
.pkgfile and follow the installer prompts
To verify, open a terminal and type node --version. You should see a version number (18 or higher).
Step 2: Install Claude Code
Open a terminal (Mac: Terminal app; Windows: Command Prompt or PowerShell) and type:
npm install -g @anthropic-ai/claude-code
This downloads and installs Claude Code globally on your computer.
Step 3: Set Up Your Account
- In the terminal, type
claudeto launch Claude Code - Follow the on-screen prompts to sign in with your Anthropic account
- If you do not have an Anthropic account, create one at https://console.anthropic.com/
- Claude Code uses the Anthropic API, which requires a payment method on your account. Usage is billed per conversation. Check https://www.anthropic.com/pricing for current rates. Your instructor may provide API access for class use.
Step 4: Verify It Works
Navigate to any project folder in your terminal and type claude. You should see a prompt where you can type natural language instructions. Try typing: “What files are in this directory?” Claude Code will respond with a list of files.
Troubleshooting
- “npm: command not found”: Node.js is not installed correctly. Reinstall Node.js and make sure to check “Add to PATH” during installation (Windows) or restart your terminal (Mac).
- Permission errors on Mac: The recommended fix is to install Node.js using a version manager like
nvm(https://github.com/nvm-sh/nvm), which avoids permission issues entirely. As a last resort, you can trysudo npm install -g @anthropic-ai/claude-code, but this may cause permission problems with future npm operations. - Claude Code does not start: Ensure you have an active internet connection and a valid Anthropic account.
For the most up-to-date installation instructions, visit https://github.com/anthropics/claude-code.