{"record":{"id":"9624df6130521d32","repo":"HKUDS/nanobot","slug":"could-not-install-tui-dependencies-exc","errorCode":null,"errorMessage":"could not install TUI dependencies: {exc}","messagePattern":"could not install TUI dependencies: (.+?)","errorType":"exception","errorClass":"TuiUnavailableError","httpStatus":null,"severity":"error","filePath":"nanobot/cli/tui_launcher.py","lineNumber":228,"sourceCode":"    project_root = project_root.resolve(strict=False)\n    source_dir = project_root / \"tui\"\n    if (project_root / \"pyproject.toml\").is_file() and (source_dir / \"package.json\").is_file():\n        return source_dir\n    return None\n\n\ndef _resolve_source_tui_command(source_dir: Path, bun: str) -> list[str]:\n    dependency = source_dir / \"node_modules\" / \"@opentui\" / \"core\"\n    try:\n        install = subprocess.run(\n            [bun, \"install\", \"--frozen-lockfile\"],\n            cwd=source_dir,\n            capture_output=True,\n            text=True,\n            check=False,\n        )\n    except OSError as exc:\n        raise TuiUnavailableError(f\"could not install TUI dependencies: {exc}\") from exc\n    if install.returncode != 0 or not dependency.is_dir():\n        detail = (install.stderr or install.stdout).strip().splitlines()\n        suffix = f\": {detail[-1]}\" if detail else \"\"\n        raise TuiUnavailableError(f\"could not install TUI dependencies{suffix}\")\n    executable = named_executable(\n        bun,\n        name=\"nanobot-tui\",\n        directory=get_data_dir() / \"run\" / \"executables\",\n    )\n    return [executable, str(source_dir / \"src\" / \"index.ts\")]\n\n\ndef _download_release_tui(asset: str) -> Path | None:\n    \"\"\"Install the complete, version-matched TUI release bundle.\"\"\"\n    if os.environ.get(\"NANOBOT_TUI_NO_DOWNLOAD\") == \"1\":\n        return None\n    version = __version__.strip()\n    if not version or version.endswith((\".dev0\", \"+dev\")):","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/cli/tui_launcher.py#L210-L246","documentation":"In _resolve_source_tui_command, running `bun install --frozen-lockfile` in the TUI source directory raised OSError (bun could not be executed, cwd missing, etc.). The launcher wraps it in TuiUnavailableError with the OS detail because the TUI cannot run without its locked node_modules dependencies.","triggerScenarios":"Thrown at nanobot/cli/tui_launcher.py:228 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run `nanobot agent` once the transient OS issue (permissions, missing directory) is fixed","Verify bun is executable and the tui/ directory is intact","Use `nanobot agent --classic` to bypass the native TUI"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","contentChangedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}