Claude Code · Install and setup
syntax error near unexpected token `<' when installing Claude Code
The install URL returned a web page instead of the install script, usually because Claude Code isn’t available in your region or a proxy blocked it.
Message
The exact error
bash: line 1: syntax error near unexpected token `<'
bash: line 1: `<!DOCTYPE html>'Also appears as:
- PowerShell
- iex : At line:1 char:2310 … Missing argument in parameter list.
- Blocked download
- curl: (22) The requested URL returned error: 403
Meaning
What it means
The install command downloads a script and runs it. Here the download returned an HTML page (or a 403 error), and your shell tried to run the HTML as code. If the page says “App unavailable in region”, Claude Code isn’t offered in your country.
Causes
Common causes
- Claude Code isn’t available in your country
- A corporate proxy or firewall blocking the download
- A temporary routing or service problem
Fix
How to fix it
Check availability
See Anthropic’s supported countries.
Use a package manager instead
Then open a new terminal and run
claude --version.macOS (Homebrew) brew install --cask claude-codeWindows (WinGet) winget install Anthropic.ClaudeCodeCheck whether a proxy blocks it
A
200status means you can reach the download server; a403usually means a proxy or regional block.macOS / Linux curl -sI https://downloads.claude.ai/claude-code-releases/latestWindows PowerShell curl.exe -sI https://downloads.claude.ai/claude-code-releases/latestWait and retry
If none of the above applies, the problem is often temporary.
Related