aaif-goose/goose · critical

No goose binary available for ${key}. Set GOOSE_BINARY to th

Error message

No goose binary available for ${key}. Set GOOSE_BINARY to the path of a goose binary.

What it means

resolveGooseBinary() in the @aaif/goose SDK first honors GOOSE_BINARY, then looks up a platform key `${process.platform}-${process.arch}` in the PLATFORMS map to find the optional @aaif/goose-binary-* dependency. This error means the key itself is unknown — the SDK has no binary package name for this OS/architecture combination at all (e.g. linux-arm64, freebsd-x64), so installation of a native package cannot even be attempted.

Source

Thrown at ui/sdk/src/resolve-binary.ts:28

};

/**
 * Resolves the path to the goose binary.
 *
 * Resolution order:
 *   1. `GOOSE_BINARY` environment variable (explicit override)
 *   2. Platform-specific `@aaif/goose-binary-*` optional dependency
 *
 * @throws if no binary can be found
 */
export function resolveGooseBinary(): string {
  const envBinary = process.env.GOOSE_BINARY;
  if (envBinary) return envBinary;

  const key = `${process.platform}-${process.arch}`;
  const pkg = PLATFORMS[key];
  if (!pkg) {
    throw new Error(
      `No goose binary available for ${key}. Set GOOSE_BINARY to the path of a goose binary.`,
    );
  }

  try {
    const require = createRequire(import.meta.url);
    const pkgDir = dirname(require.resolve(`${pkg}/package.json`));
    const binName = process.platform === "win32" ? "goose.exe" : "goose";
    return join(pkgDir, "bin", binName);
  } catch {
    throw new Error(
      `goose binary package ${pkg} is not installed. Set GOOSE_BINARY or install the native package.`,
    );
  }
}

View on GitHub (pinned to 3810898a74)

Solutions

  1. Set GOOSE_BINARY to an absolute path of a goose binary you built or downloaded for this platform — it short-circuits before the PLATFORMS lookup
  2. Verify the exact key in the message (e.g. 'linux-arm64') against the SDK's PLATFORMS table; if missing, that platform is genuinely unsupported in this version
  3. Upgrade the SDK — newer releases add platform entries
  4. Run under Rosetta/qemu-user on a supported arch as a stopgap

Example fix

# before
node -e "require('@aaif/goose')" # throws: No goose binary available for linux-arm64
# after
go build --release # or download goose for this platform
export GOOSE_BINARY=/usr/local/bin/goose
node -e "require('@aaif/goose')"
Defensive patterns

Strategy: validation

Validate before calling

import { PLATFORMS } from '@aaif/goose'; // if exported; otherwise check key
const key = `${process.platform}-${process.arch}`;
if (!process.env.GOOSE_BINARY && !PLATFORMS[key]) {
  throw new Error(`Unsupported platform ${key}; set GOOSE_BINARY`);
}

Type guard

const isSupportedPlatform = (): boolean =>
  Boolean(process.env.GOOSE_BINARY) ||
  `${process.platform}-${process.arch}` in PLATFORMS;

Try / catch

try {
  bin = resolveGooseBinary();
} catch (e) {
  if (String(e).includes('No goose binary available')) {
    bin = '/usr/local/bin/goose'; // pre-validated fallback for this deployment
  } else throw e;
}

Prevention

When it happens

Trigger: Importing @aaif/goose (or calling resolveGooseBinary()) on a machine whose `${platform}-${arch}` key (e.g. linux-arm64, freebsd-x64) has no entry in PLATFORMS; GOOSE_BINARY unset so the env override is skipped and the map lookup is the last resort.

Common situations: Running the SDK on Linux ARM servers/boards, BSD, or exotic libc variants; Docker images with unusual arch mappings; CI matrix jobs that include unsupported targets.

Related errors


AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16). Data as JSON: /api/errors/d95c958f744fed55. Report an issue: GitHub.