{"record":{"id":"854d3db568babe8a","repo":"diegosouzapw/OmniRoute","slug":"binary-not-found-in-extracted-archive","errorCode":null,"errorMessage":"Binary not found in extracted archive","messagePattern":"Binary not found in extracted archive","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/versionManager/binaryManager.ts","lineNumber":183,"sourceCode":"        await fs.unlink(archivePath);\n        throw new Error(`SHA256 checksum mismatch for ${assetName}`);\n      }\n    }\n  }\n\n  if (platform === \"windows\") {\n    // Already inside the `platform === \"windows\"` branch of the single value\n    // detected above (or threaded in via `target`) — pass the corresponding\n    // NodeJS.Platform literal directly rather than calling os.platform() again.\n    await extractZip(archivePath, versionDir, \"win32\");\n  } else {\n    await extractTarGz(archivePath, versionDir);\n  }\n\n  await fs.unlink(archivePath).catch(() => {});\n\n  const binary = findBinaryInDir(versionDir);\n  if (!binary) throw new Error(`Binary not found in extracted archive`);\n\n  await fs.chmod(binary, 0o755);\n  return binary;\n}\n\nexport async function installVersion(version: string, dataDir?: string): Promise<string> {\n  const dir = dataDir || DEFAULT_DATA_DIR;\n  const binDir = path.join(dir, \"bin\");\n  await fs.mkdir(binDir, { recursive: true });\n\n  // Single runtime detection for this whole orchestration: read once here and\n  // thread the value into downloadRelease() and the symlink/copy decision below,\n  // instead of each step re-reading os.platform()/os.arch() independently\n  // (#10244/#10293 — redundant reads are each an independent build-folding risk).\n  const target = getTargetPlatform();\n  const binary = await downloadRelease(version, binDir, undefined, target);\n\n  const symlinkPath = path.join(binDir, managedBinaryName());","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/versionManager/binaryManager.ts#L165-L201","documentation":"Error \"Binary not found in extracted archive\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/versionManager/binaryManager.ts:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}