earendil-works/pi · error
Failed to run
Error message
Failed to run ${command} ${args.join(" ")}: ${result.error?.message || result.stderr || result.stdout} What it means
Wrapper from PackageManager.runCommandSync: a helper process (npm, git, etc.) failed to spawn or exited non-zero; the spawn error message, stderr, or stdout is appended. This reflects an external tool failure during package management, not a pi-internal error.
Solutions
- Run the printed command manually to see the underlying failure
- Check that npm/git are installed and on PATH
- Fix network, registry, or authentication issues reported by the tool
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at packages/coding-agent/src/core/package-manager.ts:2693 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/5cd9fdbd2e812d38.
Report an issue: GitHub.
Appendix: source
Thrown at packages/coding-agent/src/core/package-manager.ts:2693
child.on("exit", (code) => {
if (code === 0) {
resolvePromise();
} else {
reject(new Error(`${command} ${args.join(" ")} failed with code ${code}`));
}
});
});
}
private runCommandSync(command: string, args: string[]): string {
const env = getEnv();
const result = spawnProcessSync(command, args, {
stdio: ["ignore", "pipe", "pipe"],
encoding: "utf-8",
env,
});
if (result.error || result.status !== 0) {
throw new Error(
`Failed to run ${command} ${args.join(" ")}: ${result.error?.message || result.stderr || result.stdout}`,
);
}
return (result.stdout || result.stderr || "").trim();
}
}
View on GitHub (pinned to 4af9d21d3b)