claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude code CLI no longer works, crashes on startup

Open garyo opened this issue 8 months ago • 2 comments

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [X] Other: MacOS
  • Claude CLI version: latest, but can't run claude to find out
  • Operating System: MacOS 15.3
  • Terminal: Terminal App

Bug Description

Something I added or changed caused claude code to stop working but not sure what. To fix it, I uninstalled claude code and reinstalled with bun install --global claude but I still get errors on startup.

Steps to Reproduce

  1. bun install --global claude
% ~/.bun/bin/claude 
file:///Users/garyo/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:277
... lots of code dump...
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
TypeError: Cannot read properties of undefined (reading 'prototype')
    at file:///Users/garyo/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:277:25482
    at file:///Users/garyo/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:13:402
    at file:///Users/garyo/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:277:25601
    at file:///Users/garyo/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:13:402
    at file:///Users/garyo/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:279:3206
    at file:///Users/garyo/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:13:402
    at file:///Users/garyo/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:279:6228
    at file:///Users/garyo/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:13:402
    at file:///Users/garyo/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:279:7433
    at file:///Users/garyo/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:13:402

Node.js v24.0.0
%

Expected Behavior

Expect it to give me a prompt and work normally

Actual Behavior

Crashes with above error.

Additional Context

I tried removing my claude config (incl ~/Library/Application Support/claude) and uninstalling everything I could find claude-related, but no joy. It might be related to the fact that I tried aider -- I'm not sure how to remove that. I installed it via uvx aider-install, but it seems to be all python so perhaps that's unrelated.

garyo avatar May 30 '25 15:05 garyo

Hi! Does it work if you install using NodeJS, rather than Bun? npm i -g @anthropic-ai/claude-code.

bcherny avatar May 30 '25 23:05 bcherny

No, same symptom, sorry.

garyo avatar May 31 '25 12:05 garyo

Hi @garyo, there is a known issue with Node 24.0.0. Upgrading to 24.0.1 or later should resolve this.

See https://github.com/anthropics/claude-code/issues/1291.

ant-kurt avatar Jun 02 '25 18:06 ant-kurt

Confirmed, works fine with node 24.1.0. Thanks!

garyo avatar Jun 03 '25 02:06 garyo

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.

github-actions[bot] avatar Aug 13 '25 14:08 github-actions[bot]