[BUG] Upgrade command communicated fails

Resolved 💬 3 comments Opened Nov 30, 2025 by eirikora Closed Jan 30, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Running claude code on my MacBook and it fails to upgrade automatically. Then it tells me to run: npm i -g @anthropic-ai/claude-code
That command fails again.

What Should Happen?

This is very confusing for many users. The command that you should recommend is:
npm uninstall -g @anthropic-ai/claude-code && npm i -g @anthropic-ai/claude-code
(which works!)

Error Messages/Logs

eirik.ora@Eiriks-MacBook-Pro taverio % npm i -g @anthropic-ai/claude-code

npm error code ENOTEMPTY
npm error syscall rename
npm error path /Users/eirik.ora/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code
npm error dest /Users/eirik.ora/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/.claude-code-LsEBBRzx
npm error errno -66
npm error ENOTEMPTY: directory not empty, rename '/Users/eirik.ora/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code' -> '/Users/eirik.ora/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/.claude-code-LsEBBRzx'
npm error A complete log of this run can be found in: /Users/eirik.ora/.npm/_logs/2025-11-30T23_06_25_084Z-debug-0.log

Steps to Reproduce

To reproduce:
Install claude code
Wait some days/weeks until it fails auto-upgrading.
Then run the recommented command displayed by claude code (which fails): npm i -g @anthropic-ai/claude-code

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

v2.0.26

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗