earendil-works/pi · error
failed with exit code
Error message
${command} failed with exit code ${result.status ?? 1} What it means
Build-script failure in the win32 native prebuild builder: an external command spawned by run() (compiler, rc.exe, cmd.exe batch, etc.) exited with a non-zero status (spawn errors are thrown separately as result.error). It means a toolchain step of the native module build failed; the thrown error carries the exit code for diagnosis, and the process exits before temporary artifacts are cleaned by the exit handler.
Solutions
- The build command failed; run it manually to see the full error output.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/tui/native/win32/build.mjs:46 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/3bafd948afe802d9.
Report an issue: GitHub.
Appendix: source
Thrown at packages/tui/native/win32/build.mjs:46
function removeTemporaryDir() {
rmSync(temporaryDir, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 });
}
process.on("exit", removeTemporaryDir);
process.on("SIGINT", () => {
removeTemporaryDir();
process.exit(130);
});
function commandExists(command) {
const result = spawnSync(command, ["--version"], { stdio: "ignore" });
return !result.error || result.error.code !== "ENOENT";
}
function run(command, args, options = {}) {
const result = spawnSync(command, args, { stdio: "inherit", ...options });
if (result.error) throw result.error;
if (result.status !== 0) throw new Error(`${command} failed with exit code ${result.status ?? 1}`);
}
function quoteBatch(value) {
return `"${value.replaceAll('"', '""')}"`;
}
function msvcHostArch() {
return process.arch === "arm64" ? "arm64" : "x64";
}
function findVisualStudioDevCmd() {
const candidates = [];
const programFilesX86 = process.env["ProgramFiles(x86)"];
if (programFilesX86) {
const vswhere = path.join(programFilesX86, "Microsoft Visual Studio", "Installer", "vswhere.exe");
if (existsSync(vswhere)) {
const result = spawnSync(
vswhere,View on GitHub (pinned to 4af9d21d3b)