jdx/mise · error

command does not exist

Error message

command does not exist: {}

What it means

When resolving a command, an absolute path is accepted only if it points to an existing file. If the absolute path does not exist (or is a directory), the resolver bails with 'command does not exist: <path>'.

Solutions

  1. Verify the path exists with `ls -l /path/to/binary` and correct the configured command path
  2. Install the missing binary or reinstall the tool that provides it
  3. Use a bare program name instead of an absolute path so PATH lookup (`which`) resolves it

Example fix

// before
run(&["/opt/compose/bin/docker-compose", "up"]);
// after
run(&["docker", "compose", "up"]); // resolved via PATH lookup
Defensive patterns

Strategy: validation

Validate before calling

let path = std::path::Path::new(cmd_path);
if !path.is_file() { eprintln!("command does not exist: {}", path.display()); }

Type guard

fn is_executable_file(p: &std::path::Path) -> bool {
    p.is_file() && std::fs::metadata(p).map(|m| !m.is_dir()).unwrap_or(false)
}

Prevention

When it happens

Trigger: Passing a command array whose first element is an absolute path (e.g. `/usr/local/bin/compose`) to the command resolver when that file is absent on disk.

Common situations: Tool installed at a different prefix, stale hardcoded paths in config, binary removed after an upgrade, or typos in the configured path.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/a5491f64ba6b08bb. Report an issue: GitHub.

Appendix: source

Thrown at src/system/compose.rs:1102

        .into_iter()
        .map(|path| {
            if path.is_absolute() {
                path
            } else {
                project_dir.join(path)
            }
        })
        .collect()
}

fn resolve_command(command: &[String]) -> Result<Vec<String>> {
    let (program, args) = command
        .split_first()
        .ok_or_else(|| eyre!("command cannot be empty"))?;
    let resolved = if Path::new(program).is_absolute() {
        let path = PathBuf::from(program);
        if !path.is_file() {
            bail!("command does not exist: {}", path.display());
        }
        path
    } else {
        crate::file::which(program).ok_or_else(|| eyre!("command not found: {program}"))?
    };
    Ok(std::iter::once(resolved.to_string_lossy().to_string())
        .chain(args.iter().cloned())
        .collect())
}

fn validate_project_name(name: Option<&str>) -> Result<()> {
    let Some(name) = name else {
        return Ok(());
    };
    if name.is_empty()
        || !name
            .chars()
            .next()

View on GitHub (pinned to 533346cc37)