Skip to content

resolveNodeBin

resolveNodeBin(opts?): string

Defined in: src/node-bin.ts:26

Resolve a node binary for spawning the PTY attach helper (pty-attach.mjs).

The server itself runs under Bun, but the helper needs Node (node-pty is a native Node addon). When Shepherd runs under systemd or another launcher whose PATH excludes a version-manager-managed node (mise/nvm/fnm), spawning bare “node” fails — and every session pane silently stays black. Resolution order:

  1. explicit override (SHEPHERD_NODE_BIN)
  2. node on PATH
  3. known install locations (mise shims, common bin dirs)
  4. bare “node” as a last resort, so the spawn error is at least legible

ResolveNodeOpts = {}

string