JuliusBrussee/caveman · error · Error

no prebuilt binary for

Error message

no prebuilt binary for ${os}/${arch} — supported: darwin/arm64, darwin/amd64, linux/arm64, linux/amd64, win32/arm64, win32/amd64

What it means

`targetPlatform` maps process.platform/process.arch to a supported prebuilt-binary platform triple. It throws when the combination is not one of the six supported pairs (darwin/linux/win32 × arm64/amd64), because the installer cannot download a binary for that target.

Solutions

  1. Run on a supported platform: darwin/linux/win32 with arm64 or x64 (amd64) Node
  2. Use a 64-bit Node build (node -p process.arch should print arm64 or x64)
  3. On 32-bit ARM Linux, switch to a 64-bit OS image or an amd64 emulator/container
  4. Build the binary from source and install it manually if no prebuilt exists for your target

Example fix

// before (32-bit ARM board)
$ node -p process.arch
arm
// after: use 64-bit Node/OS
$ node -p process.arch
arm64
Defensive patterns

Strategy: type-guard

Validate before calling

const SUPPORTED = new Set(["darwin","linux","win32"]);
const ARCHS = new Set(["arm64","amd64"]);
const arch = process.arch === "x64" ? "amd64" : process.arch;
if (!SUPPORTED.has(process.platform) || !ARCHS.has(arch)) {
  throw new Error(`unsupported target ${process.platform}/${process.arch}; use a supported runner`);
}

Type guard

const isSupportedTarget = (os, nodeArch) =>
  ["darwin","linux","win32"].includes(os) &&
  ["arm64","amd64"].includes(nodeArch === "x64" ? "amd64" : nodeArch);

Try / catch

try {
  const { os, arch } = targetPlatform();
  await installBinary(os, arch);
} catch (e) {
  if (String(e.message).startsWith("no prebuilt binary for")) {
    console.error("Run on darwin/linux/win32 (arm64/x64) or build the binary from source");
    process.exitCode = 1;
  } else throw e;
}

Prevention

When it happens

Trigger: Running the installer on an unsupported OS (e.g. freebsd, openbsd, sunos) or unsupported architecture (e.g. ia32, armv7l, ppc64, s390x, mips).

Common situations: CI runner on a 32-bit Node (x64→amd64 works but ia32 stays ia32); Raspberry Pi on 32-bit ARM (arm); Alpine/FreeBSD container; exotic arch in a QEMU-emulated build job.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20). Data as JSON: /api/errors/a60597b1fbb57e0e. Report an issue: GitHub.

Appendix: source

Thrown at packages/shared/binary-installer/installer.mjs:69

}

function onPath(name) {
  if (isAbsolute(name) || /[\\/]/.test(name)) return executable(name) ? name : null;
  for (const dir of (process.env.PATH ?? "").split(delimiter)) {
    if (!dir) continue;
    for (const candidate of executableCandidateNames(name)) {
      const path = join(dir, candidate);
      if (executable(path)) return path;
    }
  }
  return null;
}

export function targetPlatform(os = process.platform, nodeArch = process.arch) {
  const arch = nodeArch === "x64" ? "amd64" : nodeArch;
  if (!(os === "darwin" || os === "linux" || os === "win32") ||
      !(arch === "arm64" || arch === "amd64")) {
    throw new Error(`no prebuilt binary for ${os}/${arch} — supported: darwin/arm64, darwin/amd64, linux/arm64, linux/amd64, win32/arm64, win32/amd64`);
  }
  return { os, arch };
}

export function binaryInstallFilename(name, os = process.platform) {
  return os === "win32" ? `${name}.exe` : name;
}

function timeoutMs() {
  const raw = process.env.CAVE_SETUP_TIMEOUT ?? "300";
  const seconds = Number(raw);
  if (!Number.isInteger(seconds) || seconds <= 0) {
    throw new Error(`CAVE_SETUP_TIMEOUT must be a positive integer (got ${JSON.stringify(raw)})`);
  }
  return seconds * 1000;
}

async function asset(url, timeout) {

View on GitHub (pinned to 3ee70a1026)