[BUG] $HOME/.claude/local/node_modules/.bin/claude: No such file or directory when trying to run claude code

Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 5 comments · opened Sep 11, 2025 · closed Sep 14, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

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?

When trying to run Claude Code by using 'claude' in the terminal. I get the following error:

/Users/USER/.claude/local/claude: line 2: /Users/USER/.claude/local/node_modules/.bin/claude: No such file or directory
/Users/USER/.claude/local/claude: line 2: exec: /Users/USER/.claude/local/node_modules/.bin/claude: cannot execute: No such file or directory

This started occuring recently after having made changes to my mcp servers in claude_config. However, this could be largely unrelated as emptying this file has no effect. Claude Desktop also still works with the claude_config.json filled with MCP servers.

What Should Happen?

I expect claude code to open.

Error Messages/Logs

/Users/USER/.claude/local/claude: line 2: /Users/USER/.claude/local/node_modules/.bin/claude: No such file or directory
/Users/USER/.claude/local/claude: line 2: exec: /Users/USER/.claude/local/node_modules/.bin/claude: cannot execute: No such file or directory

Steps to Reproduce

Not entirely sure how to recreate, other than removing the file at .bin/claude and then running claude code.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

N/A (cannot run claude --version, however, installed the most recent version as of 11-09-2025)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

5 Comments

github-actions[bot] · 1 year ago

---

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/7238

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

---

ant-kurt collaborator · 1 year ago

Hey, looks like your local installation ended up in a bad state. I would recommend doing npx @anthropic-ai/claude-code /migrate-installer to get back to your previous state.

AlonParker · 1 year ago

the same

Brandsma · 1 year ago

@ant-kurt This worked.

I did first have to remove the `.claude/local/ folder. Before that I was unable to successfully run the above command. If you decide to remove that folder, double check you are not deleting anything you do not want to delete.

So for me to solve this issue:

  1. Remove ~/.claude/local/
  2. Run npx @anthropic-ai/claude-code /migrate-installer as suggested by @ant-kurt
github-actions[bot] · 1 year 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.