{"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":190,"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":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/src/npx-cli/install/setup-runtime.ts#L172-L208","documentation":"Thrown by installBun() when runBunInstaller() throws — i.e. the installer script itself failed (network, timeout, non-zero exit) OR the post-install binary check failed (error 34). It wraps the underlying error with platform-specific manual install instructions and a describeExecError() dump of stdout/stderr. This is the user-facing failure for bun auto-install.","triggerScenarios":"curl cannot reach bun.sh (offline, proxy, firewall). The installer script exits non-zero. INSTALL_TIMEOUT_MS exceeded (execSync timeout). bash shell not available for the pipe. The post-install isBunInstalled() check fails and error 34 propagates into this catch. Corporate proxy mangling the install script.","commonSituations":"Air-gapped or proxy-filtered networks. Slow connections hitting the install timeout. Locked-down Windows machines where powershell remoting is restricted. Sandboxed CI without outbound network.","solutions":["Follow the manual instructions in the error: install bun via winget/brew/curl into a PATH directory, then re-run claude-mem install.","If network is the cause, configure HTTP(S)_PROXY for the install or pre-install bun on a connected machine and copy it in.","If the error's 'Underlying error' section shows a timeout, retry on a faster connection or raise INSTALL_TIMEOUT_MS.","Confirm `bun --version` works in the same shell before retrying, so the post-install check passes."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  installBun();\n} catch (e) {\n  if (e instanceof Error && /Failed to install Bun/.test(e.message)) {\n    // parse manualInstructions, prompt user to install bun by hand, then retry\n  }\n  throw e;\n}","preventionTips":["In network-restricted environments, pre-install bun via winget/brew/npm on PATH.","Configure HTTP(S)_PROXY so the curl|bash installer can reach bun.sh.","Raise INSTALL_TIMEOUT_MS on slow links or run the installer manually before invoking claude-mem."],"tags":["install","bun","runtime","network","dependencies"],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}