Hmbown/CodeWhale · error · Error

Prebuilt Codewhale Linux binaries require GLIBC_

Error message

Prebuilt Codewhale Linux binaries require GLIBC_${formatVersion(required)}, but this system has glibc ${formatVersion(host)}, which is too old for that asset.\n\nThe Linux x64 release asset is a static (musl) build that runs on any glibc,\nbut the Linux arm64 asset is a GNU libc build linked against\nUbuntu 24.04/glibc 2.39, which Ubuntu 22.04 (glibc 2.35) cannot run.\n\n${buildFromSourceHint()}\n\nSet CODEWHALE_SKIP_GLIBC_CHECK=1 to bypass this check at your own risk.

What it means

preflightGlibc() compares the host's detected glibc version against the minimum required by the prebuilt Linux arm64 asset (built on Ubuntu 24.04 / glibc 2.39). When the host version is older, the installer throws so the binary would not fail later with GLIBC_* not found.

Solutions

  1. Upgrade the OS to one shipping glibc >= 2.39 (e.g. Ubuntu 24.04)
  2. Use an x64 host/machine where the asset is a static musl build needing no glibc check
  3. Build Codewhale from source for your distro
  4. Set CODEWHALE_SKIP_GLIBC_CHECK=1 only if you know the binary will run
Defensive patterns

Strategy: validation

Validate before calling

const { detectHostGlibc } = require("./scripts/preflight-glibc.js");
const REQUIRED = [2, 39];
function cmp([a,b],[c,d]){return a!==c?a-c:b-d;}
const host = detectHostGlibc();
if (process.platform === "linux" && process.arch === "arm64" && (!host || cmp(host, REQUIRED) < 0)) {
  console.warn("glibc too old for arm64 prebuilt; upgrade OS or build from source");
}

Try / catch

try { await ensureBinary(); } catch (e) { if (/which is too old/.test(e.message)) { await buildFromSource(); } else throw e; }

Prevention

When it happens

Trigger: ensureBinary/adoptExistingBinaryIfValid call preflightGlibc on a Linux arm64 host whose detected glibc version is numerically less than the required version (e.g. 2.35 < 2.39).

Common situations: Ubuntu 22.04 (glibc 2.35) or Debian 11/12 arm64 machines installing the npm package; older LTS CI runners on arm64.

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/3463fa0856c131cf. Report an issue: GitHub.

Appendix: source

Thrown at npm/codewhale/scripts/preflight-glibc.js:131

function preflightGlibc(filePath) {
  if (!isLinux()) return;
  if (skipGlibcCheck()) {
    return;
  }

  const required = detectBinaryRequiredGlibc(filePath);
  if (!required) {
    // Statically linked / musl binary, or no GLIBC_* version dependencies present.
    return;
  }

  const host = detectHostGlibc();
  if (!host) {
    throw new Error(glibcCompatibilityMessage(required, null));
  }

  if (compareVersion(host, required) < 0) {
    throw new Error(glibcCompatibilityMessage(required, host));
  }
}

module.exports = {
  preflightGlibc,
  detectHostGlibc,
  detectBinaryRequiredGlibc,
  // exported for tests
  _internal: {
    parseVersion,
    compareVersion,
    formatVersion,
    glibcCompatibilityMessage,
    skipGlibcCheck,
  },
};

View on GitHub (pinned to 433685b202)