diegosouzapw/OmniRoute · error · Error

Download failed: ${res.status}

Error message

Download failed: ${res.status}

What it means

Error "Download failed: ${res.status}" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/versionManager/binaryManager.ts:45

  const a = os.arch();
  if (a === "x64") return "amd64";
  if (a === "arm64") return "arm64";
  return "amd64";
}

export function getAssetName(platform?: Platform, arch?: Arch): string {
  const plat = platform || detectPlatform();
  const arc = arch || detectArch();
  return `CLIProxyAPI_{version}_${plat}_${arc}${plat === "windows" ? ".zip" : ".tar.gz"}`;
}

export function getTargetPlatform(): { platform: Platform; arch: Arch } {
  return { platform: detectPlatform(), arch: detectArch() };
}

async function downloadFile(url: string, dest: string, signal?: AbortSignal): Promise<void> {
  const res = await fetch(url, { signal });
  if (!res.ok || !res.body) throw new Error(`Download failed: ${res.status}`);
  const fileStream = fsSync.createWriteStream(dest);
  await pipeline(res.body as unknown as NodeJS.ReadableStream, fileStream);
}

async function extractTarGz(archivePath: string, destDir: string): Promise<void> {
  await execFileAsync("tar", ["xzf", archivePath, "-C", destDir]);
}

/**
 * #5590: Windows has no `unzip` on the system PATH — it only ships inside Git for
 * Windows' `usr/bin`, which Node's `spawn` PATH never sees, so `execFile("unzip")`
 * fails with `spawn unzip ENOENT`. Use PowerShell's built-in `Expand-Archive`
 * there (present on every supported Windows; this is the install path for the
 * Node-24-only embedded services). `execFileAsync` uses no shell, so the paths are
 * a single argument and are not shell-interpreted; the `''` escaping covers the
 * PowerShell `-Command` string and `-LiteralPath` prevents wildcard expansion.
 */
export function buildExtractZipCommand(

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/versionManager/binaryManager.ts:45 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/8414308459b34122. Report an issue: GitHub.