Skip to content

claude update fails with permission error even when npm prefix is user-owned #37753

Description

@Tlimanli

Bug Report

Version

2.1.77 (attempting to update to 2.1.81)

OS

macOS Darwin 25.3.0

Problem

claude update returns a permission error even though the npm prefix directories are owned by the current user (not root).

Exact Error

Warning: Insufficient permissions for auto-updates
Fix: Do one of: (1) Re-install node without sudo, or (2) Use `claude install` for native installation
New version available: 2.1.81 (current: 2.1.77)
Installing update...
Using global installation update method...
Error: Insufficient permissions to install update
Try running with sudo or fix npm permissions
Or consider using native installation with: claude install

Environment Details

npm prefix: /usr/local
owner of /usr/local/lib/node_modules: tallipszyc (user, not root)
owner of /usr/local/bin/claude: tallipszyc (user, not root)

Workaround

Running npm install -g @anthropic-ai/claude-code directly works without any permission issues.

Expected Behavior

claude update should succeed when the user owns the npm prefix directory, without requiring sudo.

Steps to Reproduce

  1. Install claude-code via npm globally with user-owned prefix (/usr/local)
  2. Run claude update
  3. Observe permission error despite user owning all relevant directories

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions