jdx/mise · error

Path does not exist: mise resolves this to a trust root…

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 <path>` resolves the given config path lexically to determine its trust root before recording trust. If the path does not exist, resolution could silently act on a parent directory, so mise refuses up front with this error.

Solutions

  1. cd to the project directory and run `mise trust` with no argument to trust the detected config
  2. Verify the exact config filename: ls mise.toml .mise.toml mise.local.toml and trust the one that exists
  3. Create the missing config first (mise init) if you intended to trust a new project

Example fix

// before
mise trust ./msie.toml
// after
mise trust ./mise.toml   # or just `mise trust` inside the project
Defensive patterns

Strategy: validation

Validate before calling

const { existsSync } = require('fs');
const cfg = ['mise.toml','.mise.toml','mise.local.toml'].find(existsSync);
if (!cfg) throw new Error('no mise config file found in cwd; run mise init');
exec(`mise trust ${cfg}`);

Type guard

const isExistingPath = (p: string): p is string => existsSync(p);

Try / catch

try { exec('mise trust ' + p); } catch (e) { if (String(e).startsWith('Path does not exist')) { console.error('run `mise trust` inside the project or fix the path'); } throw e; }

Prevention

When it happens

Trigger: Running `mise trust ./mise.toml` (or a directory path) where the file/dir does not exist — wrong cwd, deleted config, or a path typo; trusting a config before a repo checkout completes.

Common situations: Trust command copy-pasted from docs for a filename that differs (mise.toml vs .mise.toml vs mise.local.toml); running from the wrong directory in scripts; trusting a path a previous cleanup removed.

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/959ce24f7d3027dc. Report an issue: GitHub.

Appendix: 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 533346cc37)