{"record":{"id":"bda4bc4ea8a57742","repo":"facebook/flow","slug":"failed-to-determine-correct-binary-for-platform","errorCode":null,"errorMessage":"Failed to determine correct binary for platform ${process.platform} and arch ${process.arch}","messagePattern":"Failed to determine correct binary for platform (.+?) and arch (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/flow-for-vscode/src/utils/getVerifiedFlowBinPath.ts","lineNumber":38,"sourceCode":"\nfunction getFlowBinDirPrefixForPlatform(): null | string {\n  return process.platform === 'darwin' && process.arch === 'arm64'\n    ? 'flow-osx-arm64-v'\n    : process.platform === 'darwin' && process.arch === 'x64'\n      ? 'flow-osx-v'\n      : process.platform === 'linux' && process.arch === 'x64'\n        ? 'flow-linux64-v'\n        : process.platform === 'win32' && process.arch === 'x64'\n          ? 'flow-win64-v'\n          : null;\n}\n\nasync function getFlowBinRelativePath(\n  flowBinModulePath: string,\n): Promise<{ flowBinDirName: string; flowBinName: string }> {\n  const dirPrefix = getFlowBinDirPrefixForPlatform();\n  if (!dirPrefix) {\n    throw new Error(\n      `Failed to determine correct binary for platform ${process.platform} and arch ${process.arch}`,\n    );\n  }\n  const flowBinModuleContents = await readdir(flowBinModulePath);\n  const flowBinDirName = flowBinModuleContents.find((x) =>\n    x.startsWith(dirPrefix),\n  );\n  if (!flowBinDirName) {\n    throw new Error(\n      `Failed to find anything starting with ${dirPrefix} in ${flowBinModulePath}`,\n    );\n  }\n  const flowBinDir = path.join(flowBinModulePath, flowBinDirName);\n  const flowBinDirContents = await readdir(flowBinDir);\n  const flowBinName = flowBinDirContents.find((x) => x.startsWith('flow'));\n  if (!flowBinName) {\n    throw new Error(`Failed to find flow binary in ${flowBinDir}`);\n  }","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/facebook/flow/blob/d1341dac899a79c027762f6b423d896045287620/packages/flow-for-vscode/src/utils/getVerifiedFlowBinPath.ts#L20-L56","documentation":"getFlowBinDirPrefixForPlatform maps platform/arch to the directory prefix flow-bin ships (flow-linux64-v*, flow-osx-v*, flow-win64-v*; osx x64/arm64, linux x64, win32 x64 only). For any other combination it returns null and getFlowBinRelativePath throws with the detected platform and arch.","triggerScenarios":"Running the bundled-flow verification path on an unmapped platform/arch, e.g. linux arm64, freebsd, or win32 ia32 — process.platform/process.arch have no prefix mapping.","commonSituations":"Linux ARM64 machines (Raspberry Pi, ARM CI runners, ARM Docker hosts); BSD/Solaris; 32-bit Windows; Rosetta quirks reporting unexpected arch values.","solutions":["Point `flow.pathToFlow` at a community/locally built flow binary for your platform to bypass bundled verification","Run under an x64 emulator (Rosetta/qemu) as a workaround","Check the flow repo for an open issue/PR covering your platform (linux-arm64 is a known gap)"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"const SUPPORTED = new Set([\n  'darwin_x64',\n  'darwin_arm64',\n  'linux_x64',\n  'win32_x64',\n]);\n\nfunction bundledFlowSupported(): boolean {\n  return SUPPORTED.has(`${process.platform}_${process.arch}`);\n}","typeGuard":"function isSupportedPlatform(\n  platform: NodeJS.Platform,\n  arch: string,\n): boolean {\n  return (\n    (platform === 'darwin' && (arch === 'x64' || arch === 'arm64')) ||\n    (platform === 'linux' && arch === 'x64') ||\n    (platform === 'win32' && arch === 'x64')\n  );\n}","tryCatchPattern":null,"preventionTips":["Check platform support before enabling bundled flow","Keep a pathToFlow override ready on ARM Linux CI","Watch flow release notes for new platform builds"],"tags":["flow-bin","platform","arch","unsupported"],"backgroundTag":"unsupported-platform-arch","analyzedSha":"d1341dac899a79c027762f6b423d896045287620","analyzedAt":"2026-08-17T00:07:02.212Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}