{"record":{"id":"1a585b04115234cc","repo":"thedotmack/claude-mem","slug":"claude-mem-bun-version-probe-failed","errorCode":null,"errorMessage":"claude-mem: bun --version probe failed:","messagePattern":"claude-mem: bun --version probe failed:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/npx-cli/install/setup-runtime.ts","lineNumber":143,"sourceCode":"\nexport function getBunPath(): string | null {\n  return getToolPath('bun', bunCommonPaths());\n}\n\nfunction isBunInstalled(): boolean {\n  return getBunPath() !== null;\n}\n\nexport function getBunVersion(): string | null {\n  const bunPath = getBunPath();\n  if (!bunPath) return null;\n\n  try {\n    const result = spawnVersionProbe(bunPath, ['--version']);\n    return result.status === 0 ? result.stdout.trim() : null;\n  } catch (error) {\n    const err = error instanceof Error ? error : new Error(String(error));\n    console.warn('claude-mem: bun --version probe failed:', err);\n    return null;\n  }\n}\n\nfunction getUvPath(): string | null {\n  return getToolPath('uv', uvCommonPaths());\n}\n\nfunction isUvInstalled(): boolean {\n  return getUvPath() !== null;\n}\n\nexport function getUvVersion(): string | null {\n  const uvPath = getUvPath();\n  if (!uvPath) return null;\n\n  try {\n    const result = spawnVersionProbe(uvPath, ['--version']);","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/npx-cli/install/setup-runtime.ts#L125-L161","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Install bun (curl -fsSL https://bun.sh/install | bash) or via the project's auto-installer","Verify `which bun` resolves and `bun --version` works in the same shell/environment","If bun is on a custom path, ensure the path used for the probe is correct","Check file permissions: chmod +x on the bun binary"],"exampleFix":"// before\nconst result = spawnVersionProbe(bunPath, ['--version']); // throws if bun missing\n// after\nif (!fs.existsSync(bunPath)) {\n  console.warn('claude-mem: bun not found at', bunPath);\n  return null;\n}\nconst result = spawnVersionProbe(bunPath, ['--version']);","handlingStrategy":"fallback","validationCode":"const which = spawnSync('which', ['bun']);\nif (which.status !== 0) console.warn('bun not found; install it before proceeding');","typeGuard":"function hasBun(): boolean {\n  try { return spawnVersionProbe(bunPath, ['--version']).status === 0; } catch { return false; }\n}","tryCatchPattern":"try {\n  const v = getBunVersion();\n  if (v === null) throw new Error('bun version unavailable');\n} catch (e) {\n  // install bun or fall back to another runtime\n}","preventionTips":["Install bun in the base image or via the project's bootstrap script","Verify tool availability in CI before running install steps","Keep PATH consistent across shells, daemons, and CI"],"tags":["runtime","bun","version-probe","spawn"],"backgroundTag":"command-not-found","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}