{"record":{"id":"93f390309fc864b2","repo":"thedotmack/claude-mem","slug":"bun-installation-completed-but-binary-not-found-p","errorCode":null,"errorMessage":"Bun installation completed but binary not found. Please restart your terminal and try again.","messagePattern":"Bun installation completed but binary not found\\. Please restart your terminal and try again\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/npx-cli/install/setup-runtime.ts","lineNumber":176,"sourceCode":"\n/** Run the platform-specific Bun installer, then confirm the binary is resolvable. */\nfunction runBunInstaller(): void {\n  if (IS_WINDOWS) {\n    execSync('powershell -c \"irm bun.sh/install.ps1 | iex\"', {\n      stdio: 'pipe',\n      timeout: INSTALL_TIMEOUT_MS,\n      shell: process.env.ComSpec ?? 'cmd.exe',\n    });\n  } else {\n    execSync('curl -fsSL https://bun.sh/install | bash', {\n      stdio: 'pipe',\n      timeout: INSTALL_TIMEOUT_MS,\n      shell: '/bin/bash',\n    });\n  }\n\n  if (!isBunInstalled()) {\n    throw new Error(\n      'Bun installation completed but binary not found. Please restart your terminal and try again.',\n    );\n  }\n}\n\nfunction installBun(): void {\n  try {\n    runBunInstaller();\n  } catch (error) {\n    const err = error instanceof Error ? error : new Error(String(error));\n    const manualInstructions = IS_WINDOWS\n      ? '  - winget install Oven-sh.Bun\\n  - Or: powershell -c \"irm bun.sh/install.ps1 | iex\"'\n      : '  - curl -fsSL https://bun.sh/install | bash\\n  - Or: brew install oven-sh/bun/bun';\n    throw new Error(\n      `Failed to install Bun. Please install manually:\\n${manualInstructions}\\nThen restart your terminal and try again.\\n` +\n        `Underlying error: ${describeExecError(err)}`,\n    );\n  }","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/src/npx-cli/install/setup-runtime.ts#L158-L194","documentation":"Thrown by runBunInstaller() after the platform installer script (curl|bash or powershell irm|iex) returned exit 0 but isBunInstalled() still reports false. The installer succeeded as a process but the bun binary is not resolvable on the current PATH, so claude-mem cannot proceed — bun is mandatory for hooks. This is distinct from error 35, which covers the installer itself failing.","triggerScenarios":"The installer wrote bun to ~/.bun/bin but that directory is not on PATH in the current process. On Windows, bun installed to a user-local dir not in the current cmd PATH. A non-default BUN_INSTALL dir. The installer modified shell rc files that only take effect after a new shell. PATH not exported to the child process running install.","commonSituations":"First install on a machine where ~/.bun/bin was just added to .bashrc but the current shell predates it. CI where the install runs in a subshell whose PATH isn't refreshed. Windows installs where the per-user PATH update needs a new terminal.","solutions":["Open a new terminal so PATH is reloaded from the updated shell profile, then re-run the installer.","Prepend bun's install dir (default ~/.bun/bin) to PATH for the current process and retry.","Install bun manually (brew/winget/npm) into a directory already on PATH and re-run.","Verify with `bun --version` in the same shell before retrying the claude-mem install."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function bunOnPath(): boolean {\n  try { execSync('bun --version', { stdio: 'pipe' }); return true; } catch { return false; }\n}\nif (!bunOnPath()) { /* abort install with a PATH hint */ }","typeGuard":null,"tryCatchPattern":"try {\n  runBunInstaller();\n} catch (e) {\n  if (e instanceof Error && /binary not found/.test(e.message)) {\n    // prompt user to open a new terminal, or prepend ~/.bun/bin to PATH\n  }\n  throw e;\n}","preventionTips":["After any bun install, open a new shell so PATH includes ~/.bun/bin before retrying.","In CI, source the updated shell profile or prepend the install dir to PATH within the same job.","Verify `bun --version` works in the same shell that runs the claude-mem install."],"tags":["install","bun","runtime","path","dependencies"],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}