Previously, Anthropic distributed Claude Code via NPM:
npm install -g @anthropic-ai/claude-code
New alternatives
While the method above still works, there are now 2 alternative ways to get Claude Code.
1) Via Bash Script
curl -fsSL https://claude.ai/install.sh | bash
2) Via Homebrew
brew install --cask claude-code
These alternatives do not require NPM as a prerequisite.
Switching
1) Before switching, you should uninstall Claude Code via NPM.
npm uninstall -g @anthropic-ai/claude-code
2) Then install Claude Code via one of the alternatives.
% curl -fsSL https://claude.ai/install.sh | bash
Setting up Claude Code...
✔ Claude Code successfully installed!
Version: 2.0.32
Location: ~/.local/bin/claude
3) Run it!
claude