thedotmack/claude-mem · warning

[doctor] Failed to probe \

Error message

[doctor] Failed to probe \`${bin} --version\`:

What it means

doctor's probeVersion() wraps calls to getBunVersion()/getUvVersion() and logs this warning if either throws, returning null so the doctor report shows the dependency as undetected instead of crashing. It means the version probe itself failed, not necessarily that bun/uv is missing.

Solutions

  1. Run `bun --version` / `uv --version` manually in the same shell to reproduce the failure.
  2. Reinstall the affected tool (bun and uv installers are auto-run by claude-mem if missing).
  3. Check that the install directory is on PATH for non-interactive shells (e.g. ~/.bashrc, ~/.zshenv).
  4. Repair or remove broken symlinks/shims pointing at the binary.
  5. Re-run `npx claude-mem doctor` after fixing to confirm.

Example fix

// before
console.warn(`[doctor] Failed to probe \`${bin} --version\`:`, err);
// after (verify manually)
// $ bun --version      -> reproduces the underlying error
// $ curl -fsSL https://bun.sh/install | bash   # reinstall, then re-run doctor
Defensive patterns

Strategy: try-catch

Validate before calling

import { execFileSync } from 'child_process';
function canProbe(bin: string): boolean {
  try { execFileSync(bin, ['--version'], { stdio: 'ignore' }); return true; } catch { return false; }
}
// probeVersion(canProbe('bun') ? 'bun' : 'uv') — skip probes for broken binaries

Type guard

function isProbeError(e: unknown): e is Error & { code?: string } {
  return e instanceof Error;
}

Try / catch

try {
  return bin === 'bun' ? getBunVersion() : getUvVersion();
} catch (error) {
  const err = error instanceof Error ? error : new Error(String(error));
  console.warn(`[doctor] Failed to probe \`${bin} --version\`:`, err);
  return null;
}

Prevention

When it happens

Trigger: getBunVersion or getUvVersion throws while executing or parsing `<bin> --version` — binary exists but is broken, output redirect fails, permission error, or unexpected binary output.

Common situations: Bun/uv partially uninstalled (broken symlink on PATH); custom PATH in a non-interactive shell lacking the install dir; corrupted binary; shell shim intercepting the command.

Related errors


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

Appendix: source

Thrown at src/npx-cli/commands/doctor.ts:35

import { isPidAlive } from '../../supervisor/process-registry.js';
import { checkWindowsGitBash } from '../utils/windows-git-bash-preflight.js';

type CheckStatus = 'ok' | 'warn' | 'fail';

interface CheckResult {
  name: string;
  status: CheckStatus;
  detail: string;
  /** When false, a 'fail' does not affect the overall exit code. */
  required: boolean;
}

function probeVersion(bin: 'bun' | 'uv'): string | null {
  try {
    return bin === 'bun' ? getBunVersion() : getUvVersion();
  } catch (error) {
    const err = error instanceof Error ? error : new Error(String(error));
    console.warn(`[doctor] Failed to probe \`${bin} --version\`:`, err);
    return null;
  }
}

async function probeWorkerHealth(workerHost: string, workerPort: string): Promise<{ status: CheckStatus; detail: string }> {
  const workerUrl = `http://${workerHost}:${workerPort}`;
  const res = await fetch(`${workerUrl}/api/health`, {
    signal: AbortSignal.timeout(3000),
  });
  if (res.ok) {
    return { status: 'ok', detail: `healthy at ${workerUrl}` };
  }
  return { status: 'warn', detail: `reachable but unhealthy (HTTP ${res.status}) at ${workerUrl}` };
}

async function probeChromaCensus(): Promise<CheckResult> {
  const name = 'Chroma processes';
  if (IS_WINDOWS) {

View on GitHub (pinned to d8bc9755e7)