{"record":{"id":"be2099a5f7f41912","repo":"thedotmack/claude-mem","slug":"failed-to-install-bun-please-install-manually","errorCode":null,"errorMessage":"Failed to install Bun. Please install manually:\n${manualInstructions}\nThen restart your terminal and try again.\nUnderlying error: ${describeExecError(err)}","messagePattern":"Failed to install Bun\\. Please install manually:\n(.+?)\nThen restart your terminal and try again\\.\nUnderlying error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/npx-cli/install/setup-runtime.ts","lineNumber":215,"sourceCode":"    });\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  }\n}\n\n/** Run the platform-specific uv installer, then confirm the binary is resolvable. */\nfunction runUvInstaller(): void {\n  if (IS_WINDOWS) {\n    execSync('powershell -ExecutionPolicy ByPass -c \"irm https://astral.sh/uv/install.ps1 | iex\"', {\n      stdio: 'pipe',\n      timeout: INSTALL_TIMEOUT_MS,\n      shell: process.env.ComSpec ?? 'cmd.exe',\n    });\n  } else {\n    execSync('curl -LsSf https://astral.sh/uv/install.sh | sh', {\n      stdio: 'pipe',\n      timeout: INSTALL_TIMEOUT_MS,","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/npx-cli/install/setup-runtime.ts#L197-L233","documentation":"installBun wraps any failure from runBunInstaller into a single actionable error listing platform-specific manual install instructions (winget/PowerShell on Windows, curl/brew otherwise) plus the underlying error from describeExecError. It exists so users can fall back to a manual Bun install when the automated one fails.","triggerScenarios":"runBunInstaller throws — download failure, network error, unsupported platform shell, installer script non-zero exit, or timeout (INSTALL_TIMEOUT_MS exceeded).","commonSituations":"Corporate proxy/firewall blocking bun.sh, no network access, Windows without winget, or curl unavailable in minimal containers.","solutions":["Install Bun manually using the commands printed in the error (winget/powershell on Windows; curl script or brew otherwise).","Restart your terminal so PATH includes bun, then re-run the installer.","Inspect the 'Underlying error' line for the root cause (DNS, timeout, permission) and fix network/proxy issues."],"exampleFix":"// before\nnpx claude-mem install   # automated bun install fails behind proxy\n// after\nexport HTTPS_PROXY=http://proxy:8080\ncurl -fsSL https://bun.sh/install | bash   # or fix proxy and re-run","handlingStrategy":"try-catch","validationCode":"const hasNetwork = await fetch('https://bun.sh', { method: 'HEAD' }).then(() => true).catch(() => false);\nif (!hasNetwork) console.warn('Skipping automated bun install; install manually.');","typeGuard":null,"tryCatchPattern":"try {\n  await ensureBun();\n} catch (e) {\n  console.error(String(e)); // message already contains manual install steps\n  // offer: exec('curl -fsSL https://bun.sh/install | bash')\n}","preventionTips":["Check network/proxy reachability to bun.sh before automated installs.","Preinstall bun in Docker images and CI to avoid runtime downloads.","Keep winget/brew/curl available on target machines.","Read the 'Underlying error' section before retrying."],"tags":["bun","installation","network"],"backgroundTag":"missing-dependency","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"}