[BUG] Auto-update Fails for claude-code

Status Closed — not planned
Maintainer reply None cached
Activity 10 comments · opened Jun 4, 2025 · closed Jan 11, 2026

Bug Description
I can't update claude-code without npm uninstall -g and reinstall. Every time it says "Restart to update", nothing changes, it's always the previous version.

Environment Info

  • Platform: macos
  • Terminal: iTerm.app
  • Version: 1.0.10
  • Feedback ID: bf7d74eb-aca0-4a29-946e-edf80e54930f

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:882:11)\n    at execSync (node:child_process:954:15)\n    at YZ (file:///Users/nick/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:638:3921)\n    at file:///Users/nick/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:566:6842\n    at Q (file:///Users/nick/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:17069)\n    at Qi (file:///Users/nick/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:566:6034)\n    at XG (file:///Users/nick/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:566:5480)\n    at UO2 (file:///Users/nick/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:2002:4706)","timestamp":"2025-06-04T01:30:26.017Z"}]

View original on GitHub ↗

10 Comments

guidedways · 1 year ago

Autoupdate has never worked for me reliably - ever. It will work once every now and then. It seems it's because of npm caching these versions as latest internally. What helps every time is running the following every now and then: npm cache clean --force

juniormayhe · 1 year ago

I am using pnpm and the issue of autoupdate also happens with me. WSL on Windows 11.

this is something that I may be running

I created a directory for global packages and configured pnpm to use the new directory path

mkdir -p ~/.pnpm-global
pnpm config set global-dir ~/.pnpm-global
pnpm config set global-bin-dir ~/.pnpm-global/bin

added pnpm global bin directory to PATH and refresh the terminal

echo 'export PATH=~/.pnpm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

this is the actual command that seems to perform the manual update:

pnpm add -g @anthropic-ai/claude-code

I would rather see this automatic and working.

zetomatoz · 12 months ago

I had the same issue on macOS. Switching to the native installation completely resolved it:

npm uninstall -g @anthropic-ai/claude-code
curl -fsSL https://claude.ai/install.sh | bash
export PATH="$HOME/.local/bin:$PATH"

Note: Make sure ~/.local is owned by your user, not root. If you used sudo during setup, fix with: sudo chown -R $(whoami) ~/.local.

Auto-updates now work reliably without the npm permission issues. The native installation eliminates the underlying Node.js dependency problems causing these failures.

chaihwee79 · 12 months ago

hi @zetomatoz - thanks for the solution, i am hitting the same issue. one question - what is the different between the local and the npm global setup?

zetomatoz · 12 months ago

@chaihwee79, the auto-update on macOS fails due to permission issues when trying to update system-installed npm packages. Native avoids this entirely.

  • npm global: Depends on Node.js + npm, installs system-wide, requires permissions for updates
  • Native: Self-contained / bundled binary, installs to user directory, no external dependencies
aymuos15 · 11 months ago

Happening today for me on ubuntu

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

rmurphey · 8 months ago

This issue is absolutely still occurring, I am constantly having to delete the old install to proceed with the new install, even with --force. My MDM profile doesn't allow me to install using install.sh as it's not a Known Developer binary. Come on!

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.