Skip to content

node --help | head -n1 throws an error #51448

Closed
@jcbhmr

Description

@jcbhmr

Version

v21.5.0

Platform

Linux codespaces-6c49bb 6.2.0-1018-azure #18~22.04.1-Ubuntu SMP Tue Nov 21 19:25:02 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

node --help | head -n1

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

expected behaviour is what deno and bun do: don't error lol

What do you see instead?

@jcbhmr ➜ /workspaces/my-app (main) $ node --help | head -n1
Usage: node [options] [ script.js ] [arguments]
node:events:497
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:160:15)
    at writeGeneric (node:internal/stream_base_commons:151:3)
    at Socket._writeGeneric (node:net:952:11)
    at Socket._write (node:net:964:8)
    at writeOrBuffer (node:internal/streams/writable:564:12)
    at _write (node:internal/streams/writable:493:10)
    at Writable.write (node:internal/streams/writable:502:10)
    at print (node:internal/main/print_help:216:10)
    at node:internal/main/print_help:233:1
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'
}

Node.js v21.5.0
@jcbhmr ➜ /workspaces/my-app (main) $ echo $?
0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions