Hmbown/CodeWhale · error · Error

Unsupported architecture

Error message

Unsupported architecture: ${arch} on platform ${platform}. Supported architectures: ${supported}.

${hint}

What it means

After resolving the platform, `detectBinaryNames` checks whether ASSET_MATRIX[platform] has an entry for `os.arch()`. If the CPU architecture has no prebuilt binary pair, the installer throws with the supported arch list, choosing a special RISC-V hint on linux/riscv64 and otherwise the generic build-from-source hint.

Solutions

  1. Move to a supported architecture (x64 or arm64) — e.g. use an x64 container or emulation layer.
  2. On linux/riscv64 follow the `unsupportedRiscvHint()` output for the community build instructions.
  3. Otherwise follow `unsupportedBuildHint()` to compile from source and place the binary on PATH.
  4. Check for a newer codewhale version that added your architecture to the asset matrix and upgrade.

Example fix

// before (fails on linux/ppc64le)
FROM ubuntu:latest
RUN npm install -g codewhale
// after
FROM ubuntu:latest
RUN uname -m | grep -q x86_64 # ensure x64 base image
FROM --platform=linux/amd64 ubuntu:latest
RUN npm install -g codewhale
Defensive patterns

Strategy: fallback

Validate before calling

const okArch = { darwin: ['x64','arm64'], linux: ['x64','arm64'], win32: ['x64'] };
if (!(okArch[os.platform()] || []).includes(os.arch())) {
  console.warn(`No prebuilt binary for ${os.platform()}/${os.arch()}; plan a source build.`);
}

Try / catch

try {
  await install();
} catch (err) {
  if (String(err.message).startsWith('Unsupported architecture:')) {
    // follow the riscv or generic build hint in err.message
    await buildFromSource();
  } else throw err;
}

Prevention

When it happens

Trigger: Running the installer on an architecture absent from ASSET_MATRIX[platform], e.g. linux/riscv64, linux/ppc64le, darwin/arm64 on very old matrices, or 'arm' (32-bit) where only arm64 is shipped.

Common situations: RISC-V dev boards and CI runners; 32-bit ARM SBCs; ppc64le/s390x enterprise containers; Apple Silicon before arm64 assets were published.

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 Hmbown/CodeWhale@433685b202 (2026-09-15). Data as JSON: /api/errors/fc520ab97282b930. Report an issue: GitHub.

Appendix: source

Thrown at npm/codewhale/scripts/artifacts.js:85

};

function detectBinaryNames() {
  const rawPlatform = os.platform();
  const platform = PLATFORM_ALIASES[rawPlatform] || rawPlatform;
  const arch = os.arch();
  const defaults = ASSET_MATRIX[platform];
  if (!defaults) {
    const supported = Object.keys(ASSET_MATRIX).map(p => `'${p}'`).join(', ');
    throw new Error(
      `Unsupported platform: ${rawPlatform}. Supported platforms: ${supported}.\n\n` +
      unsupportedBuildHint(),
    );
  }
  const pair = defaults[arch];
  if (!pair) {
    const supported = Object.keys(defaults).map(a => `'${a}'`).join(', ');
    const hint = platform === "linux" && arch === "riscv64" ? unsupportedRiscvHint() : unsupportedBuildHint();
    throw new Error(
      `Unsupported architecture: ${arch} on platform ${platform}. ` +
      `Supported architectures: ${supported}.\n\n` +
      hint,
    );
  }
  return {
    platform,
    arch,
    codewhale: pair[0],
    codew: pair[1],
  };
}

function unsupportedBuildHint() {
  return [
    "No prebuilt binary is available for this platform/architecture combo.",
    "You can still run codewhale by building from source with Cargo (single binary):",
    "",

View on GitHub (pinned to 433685b202)