jdx/mise · error

Path does not exist: {} mise resolves this to a trust root b

Error message

Path does not exist: {}
mise resolves this to a trust root before recording anything, and that resolution is lexical — a path that is not there would act on its parent directory instead.

What it means

`mise trust` (trust command's resolve_config_file) refuses paths that do not exist on disk. Because mise resolves trust roots lexically (e.g. a config's parent directory), trusting a nonexistent path would silently act on its parent, which is almost never what the user wants, so it bails instead.

Source

Thrown at src/cli/trust.rs:220

}

/// The config file a user-supplied path refers to, or `None` when none was given.
///
/// The path has to exist. Trusting is not done against the path as typed: it is resolved to a
/// trust root first, and `config_root` does that by counting path components, never by looking at
/// the filesystem. A path that is not there therefore used to resolve to its *parent*, and mise
/// would trust or untrust that instead — exit 0, `trusted <parent>`, and a typo silently granting
/// trust to a directory nobody named.
///
/// Existence is the whole check. A directory with no config file in it yet still resolves, since
/// its trust root is the directory itself and trusting a project before writing its `mise.toml`
/// is a real thing to want.
pub(super) fn resolve_config_file(config_file: Option<&PathBuf>) -> Result<Option<PathBuf>> {
    let Some(config_file) = config_file else {
        return Ok(None);
    };
    if !config_file.exists() {
        bail!(
            "Path does not exist: {}\n\
             mise resolves this to a trust root before recording anything, and that resolution is \
             lexical — a path that is not there would act on its parent directory instead.",
            display_path(config_file)
        );
    }
    Ok(Some(if config_file.is_dir() {
        config_files_in_dir(config_file)
            .last()
            .cloned()
            .unwrap_or(config_file.join(&*env::MISE_DEFAULT_CONFIG_FILENAME))
    } else {
        config_file.clone()
    }))
}

impl Trust {
    fn ignore(&self) -> Result<()> {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Verify the path exists (`ls <path>`); fix typos.
  2. Create or restore the config file first, then run `mise trust`.
  3. If you meant to trust the directory's config, pass the existing config file's path (e.g. the mise.toml that actually exists).

Example fix

// before
mise trust ./configs/mise.toml   # file not created yet
// after
touch ./configs/mise.toml
mise trust ./configs/mise.toml
Defensive patterns

Strategy: validation

Validate before calling

[ -e ./mise.toml ] && mise trust ./mise.toml

Prevention

When it happens

Trigger: Running `mise trust` or `mise trust <path>` where the given config_file argument fails `config_file.exists()` inside resolve_config_file.

Common situations: Trusting a config file you deleted or moved; a typo'd path; trusting a config path before creating the file; scripts hardcoding a path that differs across machines.

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@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/959ce24f7d3027dc. Report an issue: GitHub.