Skip to content

Commit 17eb712

Browse files
committed
🤖 fix: use prebuilt node-pty to avoid build requirements
Replace node-pty with @homebridge/node-pty-prebuilt-multiarch which includes prebuilt binaries for common platforms (Linux, macOS, Windows). This allows mux to be installed on servers without requiring build tools (python3, node-gyp, make, g++). The prebuilt package is API-compatible with node-pty and works with both Node.js and Electron. Fixes the error: node-pty [1/2] > Copying prebuilds to release folder... SKIPPED Prebuild directory does not exist /usr/bin/bash: line 1: node-gyp: command not found error: install script from "node-pty" exited with 127 _Generated with `mux`_
1 parent 9928a19 commit 17eb712

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"minimist": "^1.2.8",
7474
"motion": "^12.23.24",
7575
"ollama-ai-provider-v2": "^1.5.4",
76-
"node-pty": "1.1.0-beta39",
76+
"@homebridge/node-pty-prebuilt-multiarch": "^0.11.14",
7777
"rehype-harden": "^1.1.5",
7878
"shescape": "^2.1.6",
7979
"source-map-support": "^0.5.21",

src/services/ptyService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { log } from "@/services/log";
99
import type { Runtime } from "@/runtime/Runtime";
1010
import type { TerminalSession, TerminalCreateParams, TerminalResizeParams } from "@/types/terminal";
11-
import type { IPty } from "node-pty";
11+
import type { IPty } from "@homebridge/node-pty-prebuilt-multiarch";
1212
import { SSHRuntime, type SSHRuntimeConfig } from "@/runtime/SSHRuntime";
1313
import { LocalRuntime } from "@/runtime/LocalRuntime";
1414
import { access } from "fs/promises";
@@ -98,10 +98,10 @@ export class PTYService {
9898
if (runtime instanceof LocalRuntime) {
9999
// Local: Use node-pty (dynamically import to avoid crash if not available)
100100
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
101-
let pty: typeof import("node-pty");
101+
let pty: typeof import("@homebridge/node-pty-prebuilt-multiarch");
102102
try {
103103
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment
104-
pty = require("node-pty");
104+
pty = require("@homebridge/node-pty-prebuilt-multiarch");
105105
} catch (err) {
106106
log.error("node-pty not available - local terminals will not work:", err);
107107
throw new Error(
@@ -206,10 +206,10 @@ export class PTYService {
206206

207207
// Load node-pty dynamically
208208
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
209-
let pty: typeof import("node-pty");
209+
let pty: typeof import("@homebridge/node-pty-prebuilt-multiarch");
210210
try {
211211
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment
212-
pty = require("node-pty");
212+
pty = require("@homebridge/node-pty-prebuilt-multiarch");
213213
} catch (err) {
214214
log.error("node-pty not available - SSH terminals will not work:", err);
215215
throw new Error(

0 commit comments

Comments
 (0)