nikivdev/code · error · anyhow::Error

flox is not installed. Install it from https://flox.dev/docs

Error message

flox is not installed. Install it from https://flox.dev/docs/install-flox/install/ and re-run `f doctor`.

What it means

flow doctor checks that the flox environment manager is available. ensure_flox_available looks for the flox binary and/or a ~/.flox environment directory; if neither is found it aborts with a message pointing at the official install instructions.

Source

Thrown at src/doctor.rs:80

    if maybe_install_with_zerobrew(zerobrew_available, "flox", "flox")? {
        if which::which("flox").is_ok() {
            println!("✅ flox installed via zerobrew");
            return Ok(());
        }
    }

    // Heuristic: flox-managed env leaves a .flox directory or ~/.flox directory.
    let home = home_dir();
    if home.join(".flox").exists() {
        println!(
            "✅ flox environment directory detected at {}",
            home.join(".flox").display()
        );
        return Ok(());
    }

    bail!(
        "flox is not installed. Install it from https://flox.dev/docs/install-flox/install/ and re-run `f doctor`."
    );
}

fn ensure_jj_available(zerobrew_available: bool) -> Result<()> {
    if which::which("jj").is_ok() {
        println!("✅ jj found on PATH");
        return Ok(());
    }

    if maybe_install_with_zerobrew(zerobrew_available, "jj", "jj")? {
        if which::which("jj").is_ok() {
            println!("✅ jj installed via zerobrew");
            return Ok(());
        }
    }

    vcs::ensure_jj_installed()?;

View on GitHub (pinned to a747e741ae)

Solutions

  1. Install flox per https://flox.dev/docs/install-flox/install/ and re-run `f doctor`
  2. Ensure the flox binary directory is on your PATH
  3. Confirm ~/.flox exists if you expect an environment directory rather than the binary
Defensive patterns

Strategy: validation

Validate before calling

if which::which("flox").is_err() && !dirs::home_dir().unwrap().join(".flox").exists() {
    eprintln!("Install flox from https://flox.dev/docs/install-flox/install/ first");
}

Prevention

When it happens

Trigger: Running `f doctor`/`flow doctor` on a machine where the `flox` binary is not on PATH and ~/.flox does not exist (auto-install via zerobrew did not run or failed).

Common situations: New workstation without flox installed, flox installed via a method that did not put it on PATH, or HOME set to a location without the ~/.flox directory.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/0ae0a762ca6a4220. Report an issue: GitHub.