Skip to content
Source
Sign inSign up
pingdotgg/t3code

bug: npx t3 fails silently on Linux (no Linux prebuilt for node-pty) #2621

Closedryaneggz(GitHub profile, opens in a new tab) opened this issue 4 comments

Summary

npx t3 exits with code 1 and zero bytes of output (both stdout and stderr empty) on Linux x64. The CLI itself is reachable — installing with --ignore-scripts and invoking the bin directly works correctly. The silent failure is in the install hook for node-pty@1.1.0, whose published prebuilds/ directory contains only darwin-{arm64,x64} and win32-{arm64,x64} — no Linux prebuilds. On Linux the install falls through to node-gyp rebuild, which fails when make / build-essential is absent. npx propagates the non-zero exit but suppresses install-script stderr, so the user sees nothing.

Reproduction

Environment: Node v22.22.2, Linux x64 (WSL2, glibc), no build-essential installed.

$ npx --yes -p t3@0.0.22 t3 --help 2>npx-stderr.log 1>npx-stdout.log
$ echo "exit=$? stdout=$(wc -c <npx-stdout.log) stderr=$(wc -c <npx-stderr.log)"
exit=1 stdout=0 stderr=0

Smoking gun (from ~/.npm/_logs/*-debug-0.log)

info run node-pty@1.1.0 install node_modules/node-pty node scripts/prebuild.js || node-gyp rebuild
info run node-pty@1.1.0 install { code: 1, signal: null }
gyp ERR! stack Error: not found: make
verbose exit 1

The install-script stderr is captured in the npm debug log but never surfaced to the user when invoked via npx. From the user's perspective, npx t3 exits 1 with no explanation.

Proof the CLI itself is fine

$ mkdir t3-direct && cd t3-direct && npm init -y >/dev/null
$ npm install --ignore-scripts t3@0.0.22
added 199 packages
$ node node_modules/t3/dist/bin.mjs --help
DESCRIPTION
  Run the T3 Code server.

USAGE
  t3 <subcommand> [flags] [<cwd>]
... (full help output, exit 0)

apps/server/src/bin.ts (and the bundled dist/bin.mjs) only lazy-imports node-pty from inside PTY-using code paths, so --help, --version, auth, etc. don't actually need a working PTY backend at module-load time. The CLI is reachable on Linux today — the install hook is what's blocking it.

Proof from the published tarball

$ npm pack t3@0.0.22 && tar -xzf t3-0.0.22.tgz
$ npm install --ignore-scripts t3@0.0.22
$ ls node_modules/node-pty/prebuilds/
darwin-arm64  darwin-x64  win32-arm64  win32-x64
# no linux-* directory

Affected users

Linux users without build-essential / make — the default state for most fresh containers, devcontainers, GitHub Actions runners on ubuntu-latest images that don't pre-install build tools, and casual users running npx t3 to try the tool. macOS and Windows are unaffected because prebuilds exist there.

Suggested fix

Move node-pty from dependencies → optionalDependencies in apps/server/package.json:

   "dependencies": {
     "@anthropic-ai/claude-agent-sdk": "^0.2.111",
     "@effect/platform-bun": "catalog:",
     "@effect/platform-node": "catalog:",
     "@effect/sql-sqlite-bun": "catalog:",
     "@opencode-ai/sdk": "^1.3.15",
     "@pierre/diffs": "catalog:",
     "effect": "catalog:",
-    "node-pty": "^1.1.0",
     "open": "^10.1.0"
+  },
+  "optionalDependencies": {
+    "node-pty": "^1.1.0"
   },

A failed node-pty install becomes non-fatal; --help / auth / other PTY-free subcommands keep working; only PTY-requiring subcommands fail (with a real error message instead of silently exiting 1). When node-pty does install successfully (macOS/Windows always; Linux with build tools), behaviour is unchanged. One-line diff, no breaking change.

Alternatives considered

  1. Ship Linux prebuilds for node-pty. Larger blast radius — likely upstream CI matrix work in node-pty itself, or vendoring/forking. Worth doing eventually, but doesn't need to block this fix.
  2. Try/catch + diagnostic at bin entrypoint. Wrap the node-pty import and print a clear "PTY backend unavailable; install build tools or use a release with prebuilt binaries" message. Doesn't fix the install — just makes the failure loud. Useful as a complement to fix #1, not a replacement.

References

  • apps/server/package.json — line listing "node-pty": "^1.1.0" in dependencies
  • apps/server/src/bin.ts — entrypoint (dist/bin.mjs after tsdown bundle, with #!/usr/bin/env node shebang)
  • node_modules/node-pty/prebuilds/ in the installed package — Linux directory absent

Happy to send a PR with the one-line fix if maintainers agree this is the desired direction.

  1. I just had my agent install build-essential... Apologies -_-

  2. Still reproducible with the current latest release.

    Environment:

    • Fedora 44, Linux x64 (glibc)
    • t3@0.0.33
    • Node v24.19.0
    • npm 11.17.0

    Running:

    npx --yes t3@latest service install

    exits with code 1 without surfacing an actionable error. Re-running with lifecycle scripts attached to the foreground:

    npm_config_foreground_scripts=true npx --yes t3@latest service install

    reveals the actual failure:

    > Checking prebuilds...
    > Rebuilding because directory .../node-pty/prebuilds/linux-x64 does not exist
    gyp info using node-gyp@12.4.0
    gyp info using node@24.19.0 | linux | x64
    gyp ERR! stack Error: not found: make

    I also verified that make, gcc, and gcc-c++ were absent, while Python was installed. So this remains the same failure mode described here: no Linux node-pty prebuild, fallback to a native build, and npm hiding the useful lifecycle output.

    At minimum, documenting Linux build prerequisites (for Fedora: sudo dnf install make gcc gcc-c++) and the foreground diagnostic command would make this much easier to understand. Making node-pty optional or publishing Linux prebuilds would avoid the silent install failure entirely. Could this issue be reopened since it still affects t3@0.0.33?

  3. invertium(GitHub profile, opens in a new tab)commented

    Same issue under CachyOS:

    ❯ npx t3 serve --host 192.168.178.xx
    npm notice run npx
    npm notice run 't3' serve --host 192.168.178.xx
    [11:43:36.831] WARN (#110): Grok CLI health check failed.
      { errorTag: 'PlatformError' }
    [11:43:36.882] ERROR (#5): NodePtyModuleLoadError: Failed to load node-pty for linux-x64.
        at catch (file:///home/julian/.npm/_npx/5ca66e5ae19a7ff4/node_modules/t3/dist/NodePtyAdapter-DVcUyBhi.mjs:89:21)
        at file:///home/julian/.npm/_npx/5ca66e5ae19a7ff4/node_modules/effect/dist/internal/effect.js:750:40
        at ~effect/Utils/internal (file:///home/julian/.npm/_npx/5ca66e5ae19a7ff4/node_modules/effect/dist/Utils.js:79:14)
        at failWithCatch (file:///home/julian/.npm/_npx/5ca66e5ae19a7ff4/node_modules/effect/dist/internal/effect.js:750:21)
        at NodePtyAdapter.make (file:///home/julian/.npm/_npx/5ca66e5ae19a7ff4/node_modules/t3/dist/NodePtyAdapter-DVcUyBhi.mjs:114:40)
        at NodePtyAdapter.make (definition) (file:///home/julian/.npm/_npx/5ca66e5ae19a7ff4/node_modules/t3/dist/NodePtyAdapter-DVcUyBhi.mjs:82:21) {
      [cause]: Error: Failed to load native module: pty.node, checked: build/Release, build/Debug, prebuilds/linux-x64: Error: Cannot find module './prebuilds/linux-x64//pty.node'
      Require stack:
      - /home/julian/.npm/_npx/5ca66e5ae19a7ff4/node_modules/node-pty/lib/utils.js
      - /home/julian/.npm/_npx/5ca66e5ae19a7ff4/node_modules/node-pty/lib/index.js
          at Object.loadNativeModule (/home/julian/.npm/_npx/5ca66e5ae19a7ff4/node_modules/node-pty/lib/utils.js:36:11)
          at Object.<anonymous> (/home/julian/.npm/_npx/5ca66e5ae19a7ff4/node_modules/node-pty/lib/unixTerminal.js:27:22)
          at Module._compile (node:internal/modules/cjs/loader:1944:14)
          at Object..js (node:internal/modules/cjs/loader:2084:10)
          at Module.load (node:internal/modules/cjs/loader:1666:32)
          at Module._load (node:internal/modules/cjs/loader:1447:12)
          at wrapModuleLoad (node:internal/modules/cjs/loader:260:19)
          at Module.require (node:internal/modules/cjs/loader:1689:12)
          at require (node:internal/modules/helpers:191:16)
          at Object.<anonymous> (/home/julian/.npm/_npx/5ca66e5ae19a7ff4/node_modules/node-pty/lib/index.js:15:20)
    }
  4. Still affecting the current release, and on arm64 too: t3@0.0.40, Linux aarch64, Node 24.21.0 — service install succeeds but the service crash-loops with NodePtyModuleLoadError … prebuilds/linux-arm64, because node-pty@1.1.0 ships no Linux prebuilds. Same node-gyp rebuild workaround as documented above unblocked it (requires a local toolchain). Adding my arm64 data point to the open tracker in #6012.

Sign in to join this conversation.