Installing Claude Code
Let's get Claude Code installed. The process takes about 5 minutes.
Step 1: Install Node.js
Claude Code requires Node.js. Check if you have it:
$ node --version
v20.10.0
โ
If you see a version number (v18 or higher), skip to Step 2!
Installing Node.js
macOS (recommended):
# Install Homebrew first (if not installed)
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Node.js
$ brew install node
# Verify
$ node --version
โ
Windows:
- Download from nodejs.org
- Run the installer
- Restart your terminal
Linux:
$ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
$ sudo apt-get install -y nodejs
โ
Step 2: Install Claude Code
$ npm install -g @anthropic-ai/claude-code
โ
โTip
The -g flag installs it globally, so you can use it from any folder.
If you get permission errors:
# macOS/Linux
$ sudo npm install -g @anthropic-ai/claude-code
# Or fix npm permissions (better long-term)
$ mkdir ~/.npm-global
$ npm config set prefix '~/.npm-global'
# Add to your shell config: export PATH=~/.npm-global/bin:$PATH
โ
Step 3: Authenticate
This opens a browser window. Sign in with your Anthropic account (create one if needed).
โ Warning
Claude Code uses API credits. New accounts get some free credits. After that, it's pay-per-use (very affordable for learning).
Step 4: Verify Installation
$ claude --version
Claude Code v1.x.x
$ claude --help
Claude Code - AI coding assistant
Commands:
claude [prompt] Start session or run prompt
claude auth Authenticate with Anthropic
...
โ
Quick Test
$ mkdir test-project
$ cd test-project
$ claude "Create a hello world HTML file"
โ
If Claude creates an HTML file, you're all set! ๐
๐ฆ๐บAussie Note
Having trouble? The Anthropic Discord is friendly and responsive. Just search "Claude Code install [your issue]". ๐ฆ
Troubleshooting
"command not found: claude"
- Make sure npm global bin is in your PATH
- Try opening a new terminal window
Authentication fails
- Clear cookies and try again
- Check your internet connection
API errors
- Verify your account at console.anthropic.com
- Check you have API credits
Key Takeaways
- Claude Code needs Node.js v18+
- Install with
npm install -g @anthropic-ai/claude-code - Authenticate with
claude auth - Test with a simple prompt to verify it works