{"record":{"id":"a5491f64ba6b08bb","repo":"jdx/mise","slug":"command-does-not-exist","errorCode":null,"errorMessage":"command does not exist: {}","messagePattern":"command does not exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/compose.rs","lineNumber":1102,"sourceCode":"        .into_iter()\n        .map(|path| {\n            if path.is_absolute() {\n                path\n            } else {\n                project_dir.join(path)\n            }\n        })\n        .collect()\n}\n\nfn resolve_command(command: &[String]) -> Result<Vec<String>> {\n    let (program, args) = command\n        .split_first()\n        .ok_or_else(|| eyre!(\"command cannot be empty\"))?;\n    let resolved = if Path::new(program).is_absolute() {\n        let path = PathBuf::from(program);\n        if !path.is_file() {\n            bail!(\"command does not exist: {}\", path.display());\n        }\n        path\n    } else {\n        crate::file::which(program).ok_or_else(|| eyre!(\"command not found: {program}\"))?\n    };\n    Ok(std::iter::once(resolved.to_string_lossy().to_string())\n        .chain(args.iter().cloned())\n        .collect())\n}\n\nfn validate_project_name(name: Option<&str>) -> Result<()> {\n    let Some(name) = name else {\n        return Ok(());\n    };\n    if name.is_empty()\n        || !name\n            .chars()\n            .next()","sourceCodeStart":1084,"sourceCodeEnd":1120,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/compose.rs#L1084-L1120","documentation":"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>'.","triggerScenarios":"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.","commonSituations":"Tool installed at a different prefix, stale hardcoded paths in config, binary removed after an upgrade, or typos in the configured path.","solutions":["Verify the path exists with `ls -l /path/to/binary` and correct the configured command path","Install the missing binary or reinstall the tool that provides it","Use a bare program name instead of an absolute path so PATH lookup (`which`) resolves it"],"exampleFix":"// before\nrun(&[\"/opt/compose/bin/docker-compose\", \"up\"]);\n// after\nrun(&[\"docker\", \"compose\", \"up\"]); // resolved via PATH lookup","handlingStrategy":"validation","validationCode":"let path = std::path::Path::new(cmd_path);\nif !path.is_file() { eprintln!(\"command does not exist: {}\", path.display()); }","typeGuard":"fn is_executable_file(p: &std::path::Path) -> bool {\n    p.is_file() && std::fs::metadata(p).map(|m| !m.is_dir()).unwrap_or(false)\n}","tryCatchPattern":null,"preventionTips":["Prefer bare program names resolved via PATH over hardcoded absolute paths","Verify binary locations after tool upgrades or prefix changes","Check configured command paths at startup with a dry-run"],"tags":["path","executable","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}