{"record":{"id":"a60597b1fbb57e0e","repo":"JuliusBrussee/caveman","slug":"no-prebuilt-binary-for-os-arch-supported-a60597","errorCode":null,"errorMessage":"no prebuilt binary for ${os}/${arch} — supported: darwin/arm64, darwin/amd64, linux/arm64, linux/amd64, win32/arm64, win32/amd64","messagePattern":"no prebuilt binary for (.+?)/(.+?) — supported: darwin/arm64, darwin/amd64, linux/arm64, linux/amd64, win32/arm64, win32/amd64","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shared/binary-installer/installer.mjs","lineNumber":69,"sourceCode":"}\n\nfunction onPath(name) {\n  if (isAbsolute(name) || /[\\\\/]/.test(name)) return executable(name) ? name : null;\n  for (const dir of (process.env.PATH ?? \"\").split(delimiter)) {\n    if (!dir) continue;\n    for (const candidate of executableCandidateNames(name)) {\n      const path = join(dir, candidate);\n      if (executable(path)) return path;\n    }\n  }\n  return null;\n}\n\nexport function targetPlatform(os = process.platform, nodeArch = process.arch) {\n  const arch = nodeArch === \"x64\" ? \"amd64\" : nodeArch;\n  if (!(os === \"darwin\" || os === \"linux\" || os === \"win32\") ||\n      !(arch === \"arm64\" || arch === \"amd64\")) {\n    throw new Error(`no prebuilt binary for ${os}/${arch} — supported: darwin/arm64, darwin/amd64, linux/arm64, linux/amd64, win32/arm64, win32/amd64`);\n  }\n  return { os, arch };\n}\n\nexport function binaryInstallFilename(name, os = process.platform) {\n  return os === \"win32\" ? `${name}.exe` : name;\n}\n\nfunction timeoutMs() {\n  const raw = process.env.CAVE_SETUP_TIMEOUT ?? \"300\";\n  const seconds = Number(raw);\n  if (!Number.isInteger(seconds) || seconds <= 0) {\n    throw new Error(`CAVE_SETUP_TIMEOUT must be a positive integer (got ${JSON.stringify(raw)})`);\n  }\n  return seconds * 1000;\n}\n\nasync function asset(url, timeout) {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/packages/shared/binary-installer/installer.mjs#L51-L87","documentation":"targetPlatform() in the shared binary installer maps process.arch x64 to amd64 and then requires os in {darwin,linux,win32} and arch in {arm64,amd64}. Any other combination (linux/386, linux/ppc64le, freebsd) has no prebuilt release artifact, so the installer refuses up front instead of downloading a mismatched binary.","triggerScenarios":"Running caveman-mcp / caveman-shrink / caveman-browse setup (ensureBinary calls targetPlatform) on 32-bit x86, armv7l, ppc64le, s390x, or a non-darwin/linux/win32 OS.","commonSituations":"Docker base images like i386/node or node on Alpine armv7; CI runners on niche architectures; Raspberry Pi 32-bit OS; corporately mandated older hardware.","solutions":["Run on one of the six supported platform/arch pairs (darwin, linux, or win32 on amd64 or arm64)","Set the binary's env var (CAVEMAN_MCP_BIN / CAVEMAN_SHRINK_BIN / CAVEMAN_BROWSE_BIN) to an executable you built or obtained yourself for your platform — ensureBinary returns it without checking the platform","Build the binary from source in your environment and point the env var at it"],"exampleFix":"# before (i386 container)\ndocker run --platform linux/386 node:20 …  # targetPlatform throws\n\n# after\ndocker run --platform linux/amd64 node:20 …  # or, for a self-built binary:\nexport CAVEMAN_MCP_BIN=/usr/local/bin/caveman-mcp-myarch","handlingStrategy":"validation","validationCode":"const os = process.platform;\nconst arch = process.arch === \"x64\" ? \"amd64\" : process.arch;\nconst supported = [\"darwin\", \"linux\", \"win32\"].includes(os) && [\"arm64\", \"amd64\"].includes(arch);\nif (!supported) process.env.CAVEMAN_MCP_BIN = \"/path/to/self-built-binary\"; // before any setup call","typeGuard":"function platformSupported(os, nodeArch) {\n  const arch = nodeArch === \"x64\" ? \"amd64\" : nodeArch;\n  return [\"darwin\", \"linux\", \"win32\"].includes(os) && [\"arm64\", \"amd64\"].includes(arch);\n}","tryCatchPattern":"try { bin = await ensureBinary({ name, envVar }); }\ncatch (e) {\n  if (/no prebuilt binary for/.test(String(e?.message))) { bin = buildFromSource(); }\n  else throw e;\n}","preventionTips":["Run containers with an explicit supported --platform (amd64 or arm64)","Pre-build and export the binary env vars for exotic architectures"],"tags":["platform","installer","architecture"],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}