Skip to content

Native installer deletes working npm install but fails to create ~/.local/bin/claude launcher #26173

@rlueder

Description

@rlueder

Bug Description

Running curl -fsSL https://claude.ai/install.sh | bash on macOS reports "successfully installed" but:

  1. Never creates ~/.local/bin/claude (the native launcher)
  2. Never creates ~/.claude/local/ (the local npm install directory)
  3. Deletes the existing working npm global install as a "cleanup" step

This leaves the user with a completely broken claude command.

Steps to Reproduce

  1. Have Claude Code installed via npm: npm install -g @anthropic-ai/claude-code
  2. Verify it works: claude --version2.1.42
  3. Run the native installer: curl -fsSL https://claude.ai/install.sh | bash
  4. Observe: output says "✔ Claude Code successfully installed!" with "Location: ~/.local/bin/claude"
  5. Observe: warning says "installMethod is native, but claude command not found at /Users/rafael/.local/bin/claude"
  6. Run claude --versioncommand not found
  7. Check ls ~/.local/bin/claudedoes not exist
  8. Check ls ~/.claude/local/does not exist

What Happens Internally

From the debug log at ~/.claude/debug/:

Install: Starting installation process (force=false, target=undefined)
Install: Calling installLatest(channelOrVersion=stable, forceReinstall=false)
Checking for native installer update to version 2.1.32
Install: installLatest returned version=2.1.32, wasUpdated=true, lockFailed=false
Install: Setup launcher completed with 1 messages
Install: Setup message: installMethod is native, but claude command not found at /Users/rafael/.local/bin/claude
Install: Cleaning up npm installations after successful install
Removed global npm installation of @anthropic-ai/claude-code
Cleaned up 1 npm installation(s)

The flow is:

  1. installLatest("stable") returns wasUpdated=true and version 2.1.32 — the install claims success
  2. setupLauncher() fails to create ~/.local/bin/claude but returns a warning message instead of throwing an error
  3. Because the install reported success, the cleanup function VdT() runs npm uninstall -g @anthropic-ai/claude-code, removing the user's working installation
  4. The bootstrap script's cleanup then removes the downloaded binary with rm -f "$binary_path"

Net result: old install deleted, new install never materialized.

Expected Behavior

  • If the launcher at ~/.local/bin/claude is not created, the install should fail (not report success)
  • The cleanup step should not remove existing working installations if the native install didn't succeed
  • At minimum, the cleanup should verify ~/.local/bin/claude exists and is executable before removing the npm global install

Environment

  • macOS 26.2 (Tahoe / Darwin 25.2.0)
  • Apple Silicon (arm64)
  • Node.js v22.14.0 (via nvm)
  • Claude Code 2.1.42 (was installed via npm install -g @anthropic-ai/claude-code)
  • Shell: zsh

Workaround

Reinstall via npm:

npm install -g @anthropic-ai/claude-code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions