Hmbown/CodeWhale · error · Error

CODEWHALE_USE_CNB_MIRROR=1 currently supports only Linux…

Error message

CODEWHALE_USE_CNB_MIRROR=1 currently supports only Linux x64 (including OpenHarmony x64); detected ${rawPlatform} ${arch}. Use the GitHub Release or set CODEWHALE_RELEASE_BASE_URL to a complete mirror for this platform.

What it means

`assertCnbMirrorSupportedPlatform` guards the CODEWHALE_USE_CNB_MIRROR fast path. The CNB mirror only hosts Linux x64 binaries (including OpenHarmony x64); on any other platform/arch the mirror cannot serve the artifact, so the installer refuses to use it and directs you to the GitHub Release or a complete mirror URL.

Solutions

  1. Unset CODEWHALE_USE_CNB_MIRROR (or set it to 0) so the installer uses the default GitHub Release source.
  2. Keep the mirror only on the linux x64 leg of a multi-platform CI matrix.
  3. Set CODEWHALE_RELEASE_BASE_URL to a mirror that carries artifacts for your full platform/arch matrix.

Example fix

// before (CI matrix global env)
env: { CODEWHALE_USE_CNB_MIRROR: 1 }
// after (limit to linux x64)
env:
  CODEWHALE_USE_CNB_MIRROR: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' ? 1 : 0 }}
Defensive patterns

Strategy: validation

Validate before calling

if (process.env.CODEWHALE_USE_CNB_MIRROR === '1' &&
    !(os.platform() === 'linux' && os.arch() === 'x64')) {
  delete process.env.CODEWHALE_USE_CNB_MIRROR; // fall back to GitHub Release
}

Prevention

When it happens

Trigger: Setting CODEWHALE_USE_CNB_MIRROR=1 (via env or npm config) while running on darwin, win32, linux-arm64, musl variants, or any non-Linux-x64 target; `releaseBaseUrl`/`selectReleaseSource` then calls the assert before choosing the download source.

Common situations: Copy-pasted CI config that enables the CNB mirror globally across a multi-platform matrix; developers in China enabling the mirror on macOS laptops; OpenHPC/cross-arch Docker builds.

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/53cc317174214ddb. Report an issue: GitHub.

Appendix: source

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

      label: "GitHub Releases",
      baseUrl: githubReleaseBaseUrl(version, repo),
    },
    {
      id: "cnb",
      label: "CNB first-party mirror",
      baseUrl: cnbReleaseBaseUrl(version),
    },
  ];
}

function assertCnbMirrorSupportedPlatform(
  rawPlatform = os.platform(),
  arch = os.arch(),
) {
  if (isCnbSupportedTarget(rawPlatform, arch)) {
    return;
  }
  throw new Error(
    "CODEWHALE_USE_CNB_MIRROR=1 currently supports only Linux x64 " +
      `(including OpenHarmony x64); detected ${rawPlatform} ${arch}. ` +
      "Use the GitHub Release or set CODEWHALE_RELEASE_BASE_URL to a " +
      "complete mirror for this platform.",
  );
}

function releaseAssetUrl(baseName, version, repo = "Hmbown/CodeWhale") {
  return releaseAssetUrlFromBase(baseName, releaseBaseUrl(version, repo));
}

function checksumManifestUrl(version, repo = "Hmbown/CodeWhale") {
  return releaseAssetUrl(CHECKSUM_MANIFEST, version, repo);
}

function releaseBinaryDirectory() {
  return path.join(__dirname, "..", "bin", "downloads");
}

View on GitHub (pinned to 433685b202)