{"record":{"id":"51109a691c920c6a","repo":"windmill-labs/windmill","slug":"failed-to-install-bun-types-automatically-e-ins","errorCode":null,"errorMessage":"Failed to install bun-types automatically: ${e instanceof Error ? e.message : e}","messagePattern":"Failed to install bun-types automatically: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/refresh/tsconfig.ts","lineNumber":432,"sourceCode":"\n  try {\n    execSync(\"bun --version\", { stdio: \"ignore\" });\n  } catch {\n    log.info(\n      \"Install bun (https://bun.sh), run 'bun add -d bun-types', then re-run 'wmill refresh tsconfig' for Bun API autocompletion.\"\n    );\n    return false;\n  }\n\n  try {\n    log.info(\n      colors.yellow(\"Installing bun-types with 'bun add -d bun-types'...\")\n    );\n    execSync(\"bun add -d bun-types\", { stdio: \"inherit\" });\n    log.info(colors.green(\"Installed bun-types.\"));\n    return true;\n  } catch (e) {\n    log.warn(\n      `Failed to install bun-types automatically: ${\n        e instanceof Error ? e.message : e\n      }`\n    );\n    log.info(\n      \"Run 'bun add -d bun-types' manually, then 'wmill refresh tsconfig', for Bun API autocompletion.\"\n    );\n    return false;\n  }\n}\n\n/**\n * One-line, non-blocking warning (to stderr) when the managed config is out of\n * date. Mirrors the prompts freshness check (`warnIfPromptsStale`) exactly:\n * gated on the *managed* file existing (= the project opted in by running\n * init/refresh), and only ever warns that it's **stale** — never about a\n * missing or unlinked user tsconfig.json. So a deliberately-unlinked / custom\n * setup is never nagged, and a not-yet-initialized project stays silent.","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/refresh/tsconfig.ts#L414-L450","documentation":"`wmill refresh tsconfig` ensures bun-types is installed so Bun API autocompletion works. If the package is missing, it attempts `bun add -d bun-types` automatically; when that shell command fails (non-zero exit or spawn error), it warns with the underlying message and tells the user to install manually.","triggerScenarios":"Bun is not installed or not on PATH, the project has no package.json / is not a bun workspace, network/registry access fails during `bun add`, or bun exits with a lockfile/permission error.","commonSituations":"Developing in an environment with only npm/yarn/pnpm installed; corporate proxy blocking the npm registry; running the command outside the package root so `bun add` has no manifest to update.","solutions":["Install bun-types manually with `bun add -d bun-types` (or `npm i -D bun-types` if bun is unavailable), then re-run `wmill refresh tsconfig`","Install Bun itself (https://bun.sh) if it is missing, then retry the refresh","Check network/registry connectivity or proxy settings if `bun add` failed on fetch"],"exampleFix":"// before\n# wmill refresh tsconfig\n# Failed to install bun-types automatically: Command failed: bun add -d bun-types\n// after\nbun add -d bun-types\nwmill refresh tsconfig","handlingStrategy":"fallback","validationCode":"which bun && bun pm ls | grep -q bun-types || echo 'bun-types missing'","typeGuard":null,"tryCatchPattern":"try { execSync('bun add -d bun-types', {stdio:'inherit'}); } catch { execSync('npm i -D bun-types', {stdio:'inherit'}); }","preventionTips":["Preinstall bun-types","Install bun in CI","Check registry access"],"tags":["cli","bun","dependency-installation"],"backgroundTag":"dependency-install-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}