{"record":{"id":"fc520ab97282b930","repo":"Hmbown/CodeWhale","slug":"unsupported-architecture-arch-on-platform-platform-supported","errorCode":null,"errorMessage":"Unsupported architecture: ${arch} on platform ${platform}. Supported architectures: ${supported}.\n\n${hint}","messagePattern":"Unsupported architecture: (.+?) on platform (.+?)\\. Supported architectures: (.+?)\\.\n\n(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"npm/codewhale/scripts/artifacts.js","lineNumber":85,"sourceCode":"};\n\nfunction detectBinaryNames() {\n  const rawPlatform = os.platform();\n  const platform = PLATFORM_ALIASES[rawPlatform] || rawPlatform;\n  const arch = os.arch();\n  const defaults = ASSET_MATRIX[platform];\n  if (!defaults) {\n    const supported = Object.keys(ASSET_MATRIX).map(p => `'${p}'`).join(', ');\n    throw new Error(\n      `Unsupported platform: ${rawPlatform}. Supported platforms: ${supported}.\\n\\n` +\n      unsupportedBuildHint(),\n    );\n  }\n  const pair = defaults[arch];\n  if (!pair) {\n    const supported = Object.keys(defaults).map(a => `'${a}'`).join(', ');\n    const hint = platform === \"linux\" && arch === \"riscv64\" ? unsupportedRiscvHint() : unsupportedBuildHint();\n    throw new Error(\n      `Unsupported architecture: ${arch} on platform ${platform}. ` +\n      `Supported architectures: ${supported}.\\n\\n` +\n      hint,\n    );\n  }\n  return {\n    platform,\n    arch,\n    codewhale: pair[0],\n    codew: pair[1],\n  };\n}\n\nfunction unsupportedBuildHint() {\n  return [\n    \"No prebuilt binary is available for this platform/architecture combo.\",\n    \"You can still run codewhale by building from source with Cargo (single binary):\",\n    \"\",","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/npm/codewhale/scripts/artifacts.js#L67-L103","documentation":"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.","triggerScenarios":"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.","commonSituations":"RISC-V dev boards and CI runners; 32-bit ARM SBCs; ppc64le/s390x enterprise containers; Apple Silicon before arm64 assets were published.","solutions":["Move to a supported architecture (x64 or arm64) — e.g. use an x64 container or emulation layer.","On linux/riscv64 follow the `unsupportedRiscvHint()` output for the community build instructions.","Otherwise follow `unsupportedBuildHint()` to compile from source and place the binary on PATH.","Check for a newer codewhale version that added your architecture to the asset matrix and upgrade."],"exampleFix":"// before (fails on linux/ppc64le)\nFROM ubuntu:latest\nRUN npm install -g codewhale\n// after\nFROM ubuntu:latest\nRUN uname -m | grep -q x86_64 # ensure x64 base image\nFROM --platform=linux/amd64 ubuntu:latest\nRUN npm install -g codewhale","handlingStrategy":"fallback","validationCode":"const okArch = { darwin: ['x64','arm64'], linux: ['x64','arm64'], win32: ['x64'] };\nif (!(okArch[os.platform()] || []).includes(os.arch())) {\n  console.warn(`No prebuilt binary for ${os.platform()}/${os.arch()}; plan a source build.`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await install();\n} catch (err) {\n  if (String(err.message).startsWith('Unsupported architecture:')) {\n    // follow the riscv or generic build hint in err.message\n    await buildFromSource();\n  } else throw err;\n}","preventionTips":["Verify `uname -m` / `os.arch()` is x64 or arm64 before using prebuilt installs.","On RISC-V or other exotic arch, plan a source build up front.","Use --platform=linux/amd64 container bases on unsupported architectures.","Keep the installer updated so newly added architectures are picked up."],"tags":["npm","installer","architecture","unsupported-platform"],"backgroundTag":"unsupported-platform","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}