{"record":{"id":"53cc317174214ddb","repo":"Hmbown/CodeWhale","slug":"codewhale-use-cnb-mirror-1-currently-supports-only-linux-x64","errorCode":null,"errorMessage":"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.","messagePattern":"CODEWHALE_USE_CNB_MIRROR=1 currently supports only Linux x64 \\(including OpenHarmony x64\\); detected (.+?) (.+?)\\. Use the GitHub Release or set CODEWHALE_RELEASE_BASE_URL to a complete mirror for this platform\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"npm/codewhale/scripts/artifacts.js","lineNumber":230,"sourceCode":"      label: \"GitHub Releases\",\n      baseUrl: githubReleaseBaseUrl(version, repo),\n    },\n    {\n      id: \"cnb\",\n      label: \"CNB first-party mirror\",\n      baseUrl: cnbReleaseBaseUrl(version),\n    },\n  ];\n}\n\nfunction assertCnbMirrorSupportedPlatform(\n  rawPlatform = os.platform(),\n  arch = os.arch(),\n) {\n  if (isCnbSupportedTarget(rawPlatform, arch)) {\n    return;\n  }\n  throw new Error(\n    \"CODEWHALE_USE_CNB_MIRROR=1 currently supports only Linux x64 \" +\n      `(including OpenHarmony x64); detected ${rawPlatform} ${arch}. ` +\n      \"Use the GitHub Release or set CODEWHALE_RELEASE_BASE_URL to a \" +\n      \"complete mirror for this platform.\",\n  );\n}\n\nfunction releaseAssetUrl(baseName, version, repo = \"Hmbown/CodeWhale\") {\n  return releaseAssetUrlFromBase(baseName, releaseBaseUrl(version, repo));\n}\n\nfunction checksumManifestUrl(version, repo = \"Hmbown/CodeWhale\") {\n  return releaseAssetUrl(CHECKSUM_MANIFEST, version, repo);\n}\n\nfunction releaseBinaryDirectory() {\n  return path.join(__dirname, \"..\", \"bin\", \"downloads\");\n}","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/npm/codewhale/scripts/artifacts.js#L212-L248","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Unset CODEWHALE_USE_CNB_MIRROR (or set it to 0) so the installer uses the default GitHub Release source.","Keep the mirror only on the linux x64 leg of a multi-platform CI matrix.","Set CODEWHALE_RELEASE_BASE_URL to a mirror that carries artifacts for your full platform/arch matrix."],"exampleFix":"// before (CI matrix global env)\nenv: { CODEWHALE_USE_CNB_MIRROR: 1 }\n// after (limit to linux x64)\nenv:\n  CODEWHALE_USE_CNB_MIRROR: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' ? 1 : 0 }}","handlingStrategy":"validation","validationCode":"if (process.env.CODEWHALE_USE_CNB_MIRROR === '1' &&\n    !(os.platform() === 'linux' && os.arch() === 'x64')) {\n  delete process.env.CODEWHALE_USE_CNB_MIRROR; // fall back to GitHub Release\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only enable CODEWHALE_USE_CNB_MIRROR on linux x64 runners.","Scope the mirror env var per matrix leg instead of globally.","Prefer CODEWHALE_RELEASE_BASE_URL with a full mirror when you need multi-platform mirror coverage."],"tags":["npm","installer","mirror","environment-variable","platform-restriction"],"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"}