[BUG] ReferenceError: ReadableStream is not defined

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

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [x] Other: Claude Code
  • Claude CLI version: latest as of 2025.06.24
  • Operating System: macOS 15.5 (arm64)
  • Terminal: iTerm2 3.5.14 with Oh My Zsh

Bug Description

Running Claude Code fails with an error.

Steps to Reproduce

  1. From iTerm2
  2. run npm install -g @anthropic-ai/claude-code
  3. run claude

Expected Behavior

Claude should launch

Actual Behavior


up to date in 400ms

24 packages are looking for funding
  run `npm fund` for details
file:///Users/FOO/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:319
<<file_contents_removed>>

ReferenceError: ReadableStream is not defined
    at file:///Users/FOO/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:319:18633
    at file:///Users/FOO/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:7:402
    at file:///Users/FOO/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:319:32045
    at file:///Users/FOO/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:7:402
    at file:///Users/FOO/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:320:6062
    at file:///Users/FOO/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:7:402
    at file:///Users/FOO/.volta/tools/image/packages/@anthropic-ai/claude-code/lib/node_modules/@anthropic-ai/claude-code/cli.js:716:1151

Additional Context

$ node -v
v22.2.0
$ npm -v
10.7.0
$ nvm -v
0.39.7

View original on GitHub ↗

11 Comments

g-adamante · 1 year ago

I had this issue and fixed it by switching to node 18 - you're likely using an outdated version of node.

duncanmcclean · 1 year ago

I'm experiencing this issue on Node 22.14.0, so I don't think it's related to the Node version.

FomasTreeman · 1 year ago

similar issue but ran npm install -g @anthropic-ai/claude-code again and no longer see this error.

amassaro · 1 year ago

My issue was that even though node -v reported an acceptable version, volta defaulted to a much older version when installing claude code. I updated my default system node for volta and it worked thereafter.

dongvng · 1 year ago

i run into the same issue with node 22.5.1

dabuside · 1 year ago

i run into the same issue with bun v1.2.2

ReferenceError: ReadableStream is not defined
    at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:278:18633
    at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:7:402
    at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:278:32045
    at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:7:402
    at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:279:6062
    at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:7:402
    at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:624:18968
claude code router service has been successfully stopped.
jamshaidali · 1 year ago

I was facing the same issue with Node version 16. I upgraded to Node 20, re-ran npm install -g @anthropic-ai/claude-code , and it fixed the issue.

SmileBuild · 12 months ago

Finally, I found the solution about "ReferenceError: ReadableStream is not defined".
Checking your file system. find out whether there are 2 different nodejs version. Sometimes it use old version(under 18) to install and run the claude code.
find old version, delete it.
or find out all the nodejs version, delete all of them.
install the lastest stable version of nodejs, it will work.

i run into the same issue with bun v1.2.2 `` ReferenceError: ReadableStream is not defined at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:278:18633 at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:7:402 at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:278:32045 at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:7:402 at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:279:6062 at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:7:402 at file:///Users/user/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:624:18968 claude code router service has been successfully stopped. ``
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.

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.