thedotmack/claude-mem · error

Bun installation completed but binary not found. Please rest

Error message

Bun installation completed but binary not found. Please restart your terminal and try again.

What it means

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.

Source

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

/** Run the platform-specific Bun installer, then confirm the binary is resolvable. */
function runBunInstaller(): void {
  if (IS_WINDOWS) {
    execSync('powershell -c "irm bun.sh/install.ps1 | iex"', {
      stdio: 'pipe',
      timeout: INSTALL_TIMEOUT_MS,
      shell: process.env.ComSpec ?? 'cmd.exe',
    });
  } else {
    execSync('curl -fsSL https://bun.sh/install | bash', {
      stdio: 'pipe',
      timeout: INSTALL_TIMEOUT_MS,
      shell: '/bin/bash',
    });
  }

  if (!isBunInstalled()) {
    throw new Error(
      'Bun installation completed but binary not found. Please restart your terminal and try again.',
    );
  }
}

function installBun(): void {
  try {
    runBunInstaller();
  } catch (error) {
    const err = error instanceof Error ? error : new Error(String(error));
    const manualInstructions = IS_WINDOWS
      ? '  - winget install Oven-sh.Bun\n  - Or: powershell -c "irm bun.sh/install.ps1 | iex"'
      : '  - curl -fsSL https://bun.sh/install | bash\n  - Or: brew install oven-sh/bun/bun';
    throw new Error(
      `Failed to install Bun. Please install manually:\n${manualInstructions}\nThen restart your terminal and try again.\n` +
        `Underlying error: ${describeExecError(err)}`,
    );
  }

View on GitHub (pinned to d768ba3643)

Solutions

  1. Open a new terminal so PATH is reloaded from the updated shell profile, then re-run the installer.
  2. Prepend bun's install dir (default ~/.bun/bin) to PATH for the current process and retry.
  3. Install bun manually (brew/winget/npm) into a directory already on PATH and re-run.
  4. Verify with `bun --version` in the same shell before retrying the claude-mem install.
Defensive patterns

Strategy: validation

Validate before calling

function bunOnPath(): boolean {
  try { execSync('bun --version', { stdio: 'pipe' }); return true; } catch { return false; }
}
if (!bunOnPath()) { /* abort install with a PATH hint */ }

Try / catch

try {
  runBunInstaller();
} catch (e) {
  if (e instanceof Error && /binary not found/.test(e.message)) {
    // prompt user to open a new terminal, or prepend ~/.bun/bin to PATH
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d768ba3643 (2026-08-12). Data as JSON: /api/errors/93f390309fc864b2. Report an issue: GitHub.