claude update fails with permission error even when npm prefix is user-owned
Resolved 💬 3 comments Opened Mar 23, 2026 by Tlimanli Closed Mar 27, 2026
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
- Install claude-code via npm globally with user-owned prefix (
/usr/local) - Run
claude update - Observe permission error despite user owning all relevant directories
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗