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.
-
Via Bash Script
curl -fsSL https://claude.ai/install.sh | bash -
Via Homebrew
brew install --cask claude-code
These alternatives do not require NPM as a prerequisite.
Switching
-
Before switching, you should uninstall Claude Code via NPM.
npm uninstall -g @anthropic-ai/claude-code -
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 -
Run it!
claude
Updating
-
Claude now includes auto-update feature, so you don't need to manually update.
-
Or, via Homebrew
brew upgrade claude-code