nikivdev/code · error

{} already exists (use --force to overwrite or --bin to inst

Error message

{} already exists (use --force to overwrite or --bin to install under a different name)

What it means

Error "{} already exists (use --force to overwrite or --bin to install under a different name)" thrown in nikivdev/code.

Source

Thrown at src/install.rs:195

    };

    ensure_flox_tools_env(&install_root, &[(flox_pkg.to_string(), spec)])?;

    let bin_name = opts.bin.clone().unwrap_or_else(|| name.to_string());
    let bin_dir = opts.bin_dir.clone().unwrap_or_else(default_bin_dir);
    fs::create_dir_all(&bin_dir)
        .with_context(|| format!("failed to create {}", bin_dir.display()))?;

    let shim_path = bin_dir.join(&bin_name);
    if shim_path.exists() && !opts.force {
        if shim_matches(&shim_path, &install_root, &bin_name).unwrap_or(false) {
            println!("{} already installed via flox.", bin_name);
            return Ok(());
        }
        if prompt_overwrite(&shim_path)? {
            // continue and overwrite
        } else {
            bail!(
                "{} already exists (use --force to overwrite or --bin to install under a different name)",
                shim_path.display()
            );
        }
    }

    write_flox_shim(&shim_path, &install_root, &bin_name)?;

    if flox_pkg != name {
        println!(
            "Installed {} (flox package {}) via flox (shim at {})",
            name,
            flox_pkg,
            shim_path.display()
        );
    } else {
        println!(
            "Installed {} via flox (shim at {})",

View on GitHub (pinned to a747e741ae)

When it happens

Trigger: Thrown at src/install.rs:195 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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