[BUG] Node.js error when `ps` is unavailable

Resolved 💬 5 comments Opened Jun 18, 2025 by Keno Closed Dec 10, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.28 (Claude Code)
  • Operating System: Debian minimal
  • Terminal: iTerm2

Bug Description

Claude code does not handle ps being unavailable gracefully and throws an internal node.js error:

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

Error: spawn ps ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn ps',
  path: 'ps',
  spawnargs: [ '-o', 'pid', '--no-headers', '--ppid', 124 ]
}

Node.js v22.15.0

Steps to Reproduce

  1. Run claude in a sandbox that does not have ps available

Expected Behavior

  1. I'd have expected this to be handle either using the builtin node.js process monitoring features or alternatively given me a nice error message to install ps.

Actual Behavior

See above error

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗