thedotmack/claude-mem · warning

claude-mem: bun --version probe failed:

Error message

claude-mem: bun --version probe failed:

What it means

getBunVersion probes the bun runtime by spawning `bun --version` and returns null when the probe throws. The library logs this warning to explain why it could not determine the bun version, which typically means the bun binary is missing, not executable, or could not be spawned.

Solutions

  1. Install bun (curl -fsSL https://bun.sh/install | bash) or via the project's auto-installer
  2. Verify `which bun` resolves and `bun --version` works in the same shell/environment
  3. If bun is on a custom path, ensure the path used for the probe is correct
  4. Check file permissions: chmod +x on the bun binary

Example fix

// before
const result = spawnVersionProbe(bunPath, ['--version']); // throws if bun missing
// after
if (!fs.existsSync(bunPath)) {
  console.warn('claude-mem: bun not found at', bunPath);
  return null;
}
const result = spawnVersionProbe(bunPath, ['--version']);
Defensive patterns

Strategy: fallback

Validate before calling

const which = spawnSync('which', ['bun']);
if (which.status !== 0) console.warn('bun not found; install it before proceeding');

Type guard

function hasBun(): boolean {
  try { return spawnVersionProbe(bunPath, ['--version']).status === 0; } catch { return false; }
}

Try / catch

try {
  const v = getBunVersion();
  if (v === null) throw new Error('bun version unavailable');
} catch (e) {
  // install bun or fall back to another runtime
}

Prevention

When it happens

Trigger: spawnVersionProbe throws while spawning bunPath with ['--version']: bunPath points to a nonexistent file, lacks execute permission, or the OS fails to spawn the process (ENOENT, EACCES, EAGAIN).

Common situations: Bun was never installed; bun is installed via a version manager not on PATH in this shell; a stale PATH entry or corrupted install; running in a minimal Docker/CI image without bun.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/1a585b04115234cc. Report an issue: GitHub.

Appendix: source

Thrown at src/npx-cli/install/setup-runtime.ts:143

export function getBunPath(): string | null {
  return getToolPath('bun', bunCommonPaths());
}

function isBunInstalled(): boolean {
  return getBunPath() !== null;
}

export function getBunVersion(): string | null {
  const bunPath = getBunPath();
  if (!bunPath) return null;

  try {
    const result = spawnVersionProbe(bunPath, ['--version']);
    return result.status === 0 ? result.stdout.trim() : null;
  } catch (error) {
    const err = error instanceof Error ? error : new Error(String(error));
    console.warn('claude-mem: bun --version probe failed:', err);
    return null;
  }
}

function getUvPath(): string | null {
  return getToolPath('uv', uvCommonPaths());
}

function isUvInstalled(): boolean {
  return getUvPath() !== null;
}

export function getUvVersion(): string | null {
  const uvPath = getUvPath();
  if (!uvPath) return null;

  try {
    const result = spawnVersionProbe(uvPath, ['--version']);

View on GitHub (pinned to d8bc9755e7)