Node.js EPIPE Error on Bash Command Execution

Resolved 💬 23 comments Opened Jul 17, 2025 by pjaol Closed Jul 30, 2025

Bug Description
claude crashes on Bash commands
node:events:502
throw er; // Unhandled 'error' event
^

Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:87:19)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
}

Node.js v22.13.0

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 1.0.55
  • Feedback ID: 70612fab-ceee-4d99-a281-256080325440

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:882:11)\n    at execSync (node:child_process:954:15)\n    at q5 (file:///Users/patrick/.nvm/versions/node/v22.13.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:727:4693)\n    at file:///Users/patrick/.nvm/versions/node/v22.13.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:41282\n    at Q (file:///Users/patrick/.nvm/versions/node/v22.13.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:14406)\n    at PF (file:///Users/patrick/.nvm/versions/node/v22.13.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:39067)\n    at $X (file:///Users/patrick/.nvm/versions/node/v22.13.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:37933)\n    at RB (file:///Users/patrick/.nvm/versions/node/v22.13.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:640:43902)","timestamp":"2025-07-17T23:16:38.736Z"}]

View original on GitHub ↗

23 Comments

fennb · 12 months ago

Me too.

Exception:

node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:95:16)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Logs (not very helpful)

[DEBUG] Bash tool invoked with command: uv run pytest lib/ai_sdk_python/tests/test_pydanticai_encoder.py::TestPydanticAIStreamEncoder::test_tool_call_streaming_order_complete_sequence -v
[DEBUG] Bash tool description: Run the specific test for tool call streaming order
[DEBUG] Writing to temp file: /Users/fenn/.claude.json.tmp.47666.1752798773817
[DEBUG] Preserving file permissions: 100644
[DEBUG] Temp file written successfully, size: 398270 bytes
[DEBUG] Applied original permissions to temp file
[DEBUG] Renaming /Users/fenn/.claude.json.tmp.47666.1752798773817 to /Users/fenn/.claude.json
[DEBUG] File /Users/fenn/.claude.json written atomically
  • Node.js v20.19.2
  • Platform: darwin
  • Version: 1.0.55
Jesssullivan · 12 months ago

Ditto, issue persists on darwin, both from bash and zsh:
claude-code: 1.0.55
node: v24.1.0

I see this unhelpful error:

node:events:485
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:87:19)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Node.js v24.1.0

✗ Claude Code exited with code 1
fennb · 12 months ago

Downgrading to 1.0.54 seems fine. For other suffering the pain (temp workaround):

claude config set --global autoUpdates false
npm install -g @anthropic-ai/claude-code@1.0.54
echo "Profit 💵!"
pjaol · 12 months ago
fennb · 12 months ago

1.0.54 seems to work for me. CLAUDE_HTTP_KEEPALIVE=0 does not fix 1.0.55 for me.

Also, I was wrong in my comment above, the command to disable autoupdate is apparently: claude config set -g autoUpdates disabled

pjaol · 12 months ago

ah I had to go into /config and disable it - it caught me out after a while

fennb · 12 months ago
ah I had to go into /config and disable it - it caught me out after a while

Turns out even that doesn't work? (which may be a separate bug in and of itself).

I've attempted to disable auto updates at least 3 different ways and none seem to actually work.

kratsg · 12 months ago

I also cannot get the auto-updates to disable. So this error keeps coming back.

ebadawy · 12 months ago

works now with me after downgrading to 1.0.54

mistercrunch · 12 months ago
I also cannot get the auto-updates to disable. So this error keeps coming back.

Same here, tried export DISABLE_AUTOUPDATER=1 and claude config set -g autoUpdates disabled, but it updates to latest at each startup.

npx @anthropic-ai/claude-code@1.0.54 seems to work as:

$ npx @anthropic-ai/claude-code@1.0.54 --version
1.0.54 (Claude Code)

Though I'm not 100% it's not updating itself when booting up, but what crashed before on 1.0.55 doesn't crash in this context. Would be nice to print the version as a boot header for reference, especially given the fact that there are issues around disabling auto-updates.

fennb · 12 months ago
> ah I had to go into /config and disable it - it caught me out after a while Turns out even that doesn't work? (which may be a separate bug in and of itself). I've attempted to disable auto updates at least 3 different ways and none seem to actually work.

Ok, after much futzing about, this appears to actually make it not auto-update:

npm install -i -g @anthropic-ai/claude-code@1.0.54
kennethdreyer · 12 months ago

Downgrading helped for me

Edit: spoke to soon. Before downgrading I could hardly do anything in CC before getting the EPIPE error. After full reset on config and clearing out everything, downgrading and trying again I got in a good 20 minutes before the EPIPE issue was back (this time on a curl command).

now it happens all the time again.

tansanDOTeth · 12 months ago

Claude is pretty unusable right now. I hope they fix this soon

kennethdreyer · 12 months ago

I downgraded to 1.0.37 and it seems to be working better.

EDIT: I spoke to soon again. After about 30 minutes the EPIPE issue is back with 1.0.37 also.

pjaol · 12 months ago

@kennethdreyer run

claude doctor

and check the version, the autoupdate usually brings you back to 1.0.55 breaking things.

I had to run /config while in claude and disable autoupdate from the menu

<img width="639" height="311" alt="Image" src="https://github.com/user-attachments/assets/ec479cf3-d9f1-4d44-860c-f8ce9f88c3f7" />

mistercrunch · 12 months ago

Reporting back, but things have been working without crashes (or auto-upgrades) flawlessly using $ npx @anthropic-ai/claude-code@1.0.54

SnakeO · 12 months ago

when will this bug be fixed?

shafty023 · 11 months ago

Is this fixed yet in the latest release? Not sure if I should upgrade.

shafty023 · 11 months ago

Has anyone tried a newer CC version to see if this is fixed?

okize · 11 months ago

@shafty023 yes, it is fixed in the newer versions

mistercrunch · 11 months ago

Is the issue around "no clear way to not auto-upgrade" fixed though?

pjaol · 11 months ago

I can confirm 1.0.63 (latest as of 07/30/25 seems to working for the past 5+ hrs for me
Auto-updating only seems to work from the submenu in a running Claude instance

Claude CLI Diagnostic
Currently running: npm-global (1.0.63)
Config install method: global
Auto-updates enabled: false
Update permissions: Yes  
github-actions[bot] · 11 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.