claude-code - 💡(How to fix) Fix [BUG] Auto-update breaks claude.exe on Windows (NVM for Windows) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54639Fetched 2026-04-30 06:40:08
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
1
Author
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

Fix Action

Workaround

Renaming the .old file back to claude.exe restores functionality, but the issue recurs on next launch.

Code Example

$ claude
/c/nvm4w/nodejs/claude: line 12: C:\nvm4w\nodejs/node_modules/@anthropic-ai/claude-code/bin/claude.exe: No such file or directory
claude
'"C:\nvm4w\nodejs\\node_modules\@anthropic-ai\claude-code\bin\claude.exe"' is not recognized as an internal or external command,
operable program or batch file.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

Bug Description

When launching claude on Windows, the auto-update process renames claude.exe to claude.exe.old.<timestamp> but fails to replace it with the new version, leaving no claude.exe in the bin directory.

Workaround

Renaming the .old file back to claude.exe restores functionality, but the issue recurs on next launch.

Environment

  • OS: Windows
  • Node: v24.15.0
  • Node manager: NVM for Windows
  • Claude Code: installed globally via npm

What Should Happen?

The auto-update should either:

  1. Successfully download and place the new claude.exe before renaming the old one
  2. Roll back to the original claude.exe if the update fails
  3. Not break the existing installation on failure

Error Messages/Logs

$ claude
/c/nvm4w/nodejs/claude: line 12: C:\nvm4w\nodejs/node_modules/@anthropic-ai/claude-code/bin/claude.exe: No such file or directory
claude
'"C:\nvm4w\nodejs\\node_modules\@anthropic-ai\claude-code\bin\claude.exe"' is not recognized as an internal or external command,
operable program or batch file.

Steps to Reproduce

  1. Install Claude Code globally via npm install -g @anthropic-ai/claude-code
  2. Run claude — works fine
  3. Close the session
  4. Run claude again — fails with: node_modules/@anthropic-ai/claude-code/bin/claude.exe: No such file or directory
  5. Inspecting the bin directory shows only claude.exe.old.<timestamp> — no claude.exe

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.123

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

No response

extent analysis

TL;DR

The auto-update process of Claude Code on Windows fails to replace the old claude.exe with the new version, leaving no executable in the bin directory.

Guidance

  • Verify that the update process is correctly downloading the new claude.exe before renaming the old one.
  • Check the auto-update script for any errors or issues that might cause it to fail to replace the old executable.
  • Consider implementing a rollback mechanism in the auto-update process to restore the original claude.exe if the update fails.
  • Inspect the node_modules/@anthropic-ai/claude-code/bin directory for any permissions issues that might prevent the new executable from being written.

Example

No code snippet is provided as the issue seems to be related to the auto-update process rather than a specific code error.

Notes

The issue seems to be specific to the Windows platform and the auto-update process of Claude Code. The fact that renaming the .old file back to claude.exe restores functionality suggests that the issue is with the update process rather than the executable itself.

Recommendation

Apply a workaround by modifying the auto-update script to implement a rollback mechanism or to correctly handle the replacement of the old executable. This will prevent the issue from recurring until a permanent fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Auto-update breaks claude.exe on Windows (NVM for Windows) [1 comments, 2 participants]