{"record":{"id":"5089d5251eaa4b47","repo":"BoundaryML/baml","slug":"baml-toolchain-version-is-not-installed","errorCode":null,"errorMessage":"BAML toolchain {version} is not installed","messagePattern":"BAML toolchain (.+?) is not installed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml/src/main.rs","lineNumber":1517,"sourceCode":"        println!(\"installed toolchains:\");\n        for version in installed {\n            println!(\"  {version}\");\n        }\n    }\n    println!();\n    println!(\"Remote versions were not checked.\");\n    println!(\"Run: baml toolchain status\");\n}\n\nfn uninstall_toolchain(version: &str) -> Result<()> {\n    if is_path_selector(version) {\n        return Err(anyhow!(\n            \"{version} is a local path and is not managed by the wrapper, so there is nothing to uninstall.\\nTo stop using it, select a managed toolchain instead.\\nRun: baml toolchain use canary\\nOr:  baml toolchain use nightly\"\n        ));\n    }\n    let dir = toolchains_dir().join(version);\n    if !dir.exists() {\n        return Err(anyhow!(\"BAML toolchain {version} is not installed\"));\n    }\n    fs::remove_dir_all(dir)?;\n    println!(\"uninstalled BAML toolchain {version}\");\n    Ok(())\n}\n\n#[cfg(any(not(feature = \"self-update\"), feature = \"no-self-update\"))]\nfn self_update() -> Result<()> {\n    Err(anyhow!(\n        \"self-update is disabled in this build.\\nUpdate BAML with your package manager.\"\n    ))\n}\n\n#[cfg(all(feature = \"self-update\", not(feature = \"no-self-update\")))]\nfn self_update() -> Result<()> {\n    let current = env::current_exe()?;\n    let manifest = fetch_wrapper_manifest()?;\n    let target = baml_release::release_host_target_triple()?;","sourceCodeStart":1499,"sourceCodeEnd":1535,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml/src/main.rs#L1499-L1535","documentation":"uninstall_toolchain checks that a managed toolchain directory exists under toolchains_dir() before removing it. If `toolchains_dir().join(version)` does not exist, this error reports the toolchain is not installed, preventing removal_dir_all from failing on a missing path.","triggerScenarios":"Running `baml toolchain uninstall <version>` where the directory toolchains_dir()/version does not exist — the version was never installed, already uninstalled, or the name is misspelled.","commonSituations":"Typos in the version string; uninstalling twice in a row; cleaning up versions after manually deleting the toolchains directory; checking with `baml toolchain status` for the actual installed set.","solutions":["Run `baml toolchain status` (or list the toolchains directory) to see installed versions and use an exact installed version name.","Treat this as a no-op if the toolchain was already removed and make your script idempotent.","Install the version first if you expected it to exist: `baml toolchain install <version>`."],"exampleFix":"// before\nbaml toolchain uninstall 0.209   # never installed / typo\n// after\nbaml toolchain status\nbaml toolchain uninstall 0.209.0   # exact installed version","handlingStrategy":"validation","validationCode":"const installed = execFileSync('baml', ['toolchain', 'status']).toString();\nif (!installed.includes(version)) throw new Error(`${version} is not installed; nothing to uninstall`);","typeGuard":null,"tryCatchPattern":"try {\n  execFileSync('baml', ['toolchain', 'uninstall', version]);\n} catch (e) {\n  if (/is not installed/.test(e.stderr?.toString() ?? '')) {\n    console.warn(`${version} already absent; treating as no-op`);\n  }\n}","preventionTips":["Copy exact version strings from `baml toolchain status`.","Make cleanup scripts idempotent by tolerating 'not installed'.","Don't uninstall the same version twice in one script run."],"tags":["cli","toolchain","uninstall","file-not-found"],"backgroundTag":"resource-not-found","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}