node-pty icon indicating copy to clipboard operation
node-pty copied to clipboard

Request: 1.1.x patch release — `latest` (1.1.0) still ships spawn-helper without exec bit

Open Activ8-AI opened this issue 6 months ago • 1 comments

Summary: PRs #858 and #866 fixed the prebuilds/darwin-{arm64,x64}/spawn-helper exec-bit packaging defect (tracked in #850), but the fix has only shipped in the 1.2.0-beta.* channel. The latest dist-tag on npm is still 1.1.0, which ships the broken tarball. Stable consumers on node-pty@^1.1.0 continue to hit the bug on a fresh install — including in environments that don't run install scripts (pnpm by default).

Reproduction (verified just now against the npm registry):

$ npm pack [email protected]
$ tar -tvf node-pty-1.1.0.tgz | grep spawn-helper
-rw-r--r-- 0 0 0 50480 ... package/prebuilds/darwin-arm64/spawn-helper
-rw-r--r-- 0 0 0  9248 ... package/prebuilds/darwin-x64/spawn-helper

$ npm pack [email protected]
$ tar -tvf node-pty-1.2.0-beta.9.tgz | grep spawn-helper
-rwxr-xr-x 0 0 0 50480 ... package/prebuilds/darwin-arm64/spawn-helper
-rwxr-xr-x 0 0 0  9248 ... package/prebuilds/darwin-x64/spawn-helper

$ npm pack [email protected]
$ tar -tvf node-pty-1.2.0-beta.12.tgz | grep spawn-helper
-rwxr-xr-x 0 0 0 50480 ... package/prebuilds/darwin-arm64/spawn-helper
-rwxr-xr-x 0 0 0  9248 ... package/prebuilds/darwin-x64/spawn-helper

Current dist-tags:

$ npm view node-pty dist-tags
{ ..., latest: '1.1.0', beta: '1.2.0-beta.12' }

Ask: Cut a 1.1.1 patch release containing #858 and #866 so stable consumers no longer have to opt into a beta (or maintain a postinstall chmod +x shim, which is a no-op under pnpm's default-secure install policy) for a packaging fix.

Workarounds available today:

  • Pin to 1.2.0-beta.12 (we're doing this in our repo, dev-only consumer).
  • Postinstall chmod +x (doesn't help pnpm).
  • In-test or in-runtime self-heal that chmods the helper after require.resolve().

Happy to test against an RC.

Activ8-AI avatar May 05 '26 23:05 Activ8-AI

Confirming this on a clean install today, in case another data point helps the case for a patch release.

node v24.15.0 · npm 11.12.1 · macOS 26.5.2 · Darwin arm64
npm install node-pty  →  [email protected]

Both shipped helpers are non-executable, not just the one for the host arch:

-rw-r--r--  node_modules/node-pty/prebuilds/darwin-x64/spawn-helper
-rw-r--r--  node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper

Every spawn fails, including one where the command itself can't be the problem:

pty.spawn('/bin/echo', ['hello'], { name: 'xterm-256color', cols: 80, rows: 24 })
// Error: posix_spawnp failed.

chmod +x node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper fixes it immediately (exit=0, output hello), but a fresh npm install puts the file back to 644, so it isn't something a project can carry as a workaround.

A second, unrelated project on this machine — installed 2026-05-26, two months before the run above — also resolved to 1.1.0, and both of its helpers are still 644. So this doesn't appear specific to one install or one npm version.

stekman08 avatar Jul 28 '26 09:07 stekman08