Files
hyperframes/packages/cli/src/runtimeVersion.ts
T
Miguel Ángel 66156bf35e revert(cli): hold the proxy fix and its Node floor for v0.10.0 (#8391)
* revert(cli): hold the proxy fix and its Node floor for v0.10.0

This reverts commit 2960319749 (#8311), except a stale fallow-ignore line it had removed.

* chore(ci): allow the revert to delete the three files the proxy fix added
2026-11-21 19:08:49 +00:00

13 lines
604 B
TypeScript

const MINIMUM_NODE_MAJOR = 22;
export function runtimeVersionError(version: string): string | null {
const major = Number.parseInt(version.split(".", 1)[0] ?? "", 10);
if (Number.isFinite(major) && major >= MINIMUM_NODE_MAJOR) return null;
return `HyperFrames requires Node.js >= ${MINIMUM_NODE_MAJOR} (current: ${version}). Switch Node versions and retry.`;
}
export function runtimeVersionJson(message: string, argv: readonly string[]): string | null {
if (!argv.includes("--json")) return null;
return JSON.stringify({ ok: false, error: { code: "node_version_unsupported", message } });
}