Hmbown/CodeWhale · error · Error

Unknown binary

Error message

Unknown binary: ${name}

What it means

The npm installer's getBinaryPath() maps a package/binary name to a prebuilt binary target path. Only a known set of names (including codewhale-tui, which aliases to codewhale since v0.9.5) is supported; anything else is rejected with this error.

Solutions

  1. Check the binary name spelling and use 'codewhale' (or 'codewhale-tui')
  2. Upgrade the npm package to the latest version so legacy names resolve to the single binary
  3. If invoking programmatically, pass the exported name from module metadata instead of a hardcoded string

Example fix

// before
const p = getBinaryPath("codewhale-cli");
// after
const p = getBinaryPath("codewhale");
Defensive patterns

Strategy: validation

Validate before calling

const { getBinaryPath } = require("./scripts/install.js");
const SUPPORTED = ["codewhale", "codewhale-tui"];
if (!SUPPORTED.includes(name)) throw new Error(`Unsupported binary name: ${name}; use one of ${SUPPORTED.join(", ")}`);
const p = getBinaryPath(name);

Try / catch

try { p = getBinaryPath(name); } catch (e) { if (!/Unknown binary/.test(e.message)) throw e; p = getBinaryPath("codewhale"); }

Prevention

When it happens

Trigger: Calling getBinaryPath (directly or via install/run) with a name not in the supported map, e.g. a renamed or removed binary name like an old codewhale-* package name, or a typo.

Common situations: Running an old npm package version whose binary name no longer exists after the v0.9.5 single-binary consolidation; third-party scripts hardcoding legacy binary names; typos in CODEWHALE binary selection env/config.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15). Data as JSON: /api/errors/bf72500ce14fcbc9. Report an issue: GitHub.

Appendix: source

Thrown at npm/codewhale/scripts/install.js:1620

      env,
    }),
  ]); // single binary
}

async function getBinaryPath(name) {
  await run({ context: "runtime" });
  const paths = binaryPaths();
  if (name === "codewhale") {
    return paths.codewhale.target;
  }
  if (name === "codew") {
    return paths.codew.target;
  }
  if (name === "codewhale-tui") {
    // v0.9.5 single-binary: codewhale-tui is now an alias to codewhale for backwards compat
    return paths.codewhale.target;
  }
  throw new Error(`Unknown binary: ${name}`);
}

module.exports = {
  getBinaryPath,
  installFailureHint,
  run,
  _internal: {
    resolvePackageVersion,
    resolveRepo,
    isOptionalInstall,
    shouldForceDownload,
    shouldDisableInstall,
    isQuietInstall,
    adoptExistingBinaryIfValid,
    shouldIgnoreInstallFailure,
    shouldSkipOptionalPostinstall,
    httpRequest,
    defaultTimeoutMs,

View on GitHub (pinned to 433685b202)