jdx/mise · error

install_mise must be an absolute path or start with ~/: {pat

Error message

install_mise must be an absolute path or start with ~/: {path:?}

What it means

mise validates the remote install_mise path must be addressable on the remote host: it must either be an absolute path starting with '/' or a home-relative path starting with '~/' . Relative paths like 'bin/mise' are ambiguous (depend on the remote CWD) and are rejected.

Source

Thrown at src/system/remote.rs:2217

fn validated_remote_command_output(output: &str) -> Result<String> {
    validated_remote_command(output.strip_suffix('\n').unwrap_or(output))
}

fn validated_absolute_remote_path_output(output: &str, kind: &str) -> Result<String> {
    let path = output.strip_suffix('\n').unwrap_or(output);
    if !path.starts_with('/') || path.contains(['\0', '\n', '\r']) {
        bail!("{kind} returned an unsafe absolute path: {path:?}");
    }
    Ok(path.to_string())
}

fn validate_install_mise_path(path: &str) -> Result<()> {
    validate_value("mise install path", path)?;
    if path.contains(['\n', '\r']) {
        bail!("install_mise must not contain a newline: {path:?}");
    }
    if !path.starts_with('/') && !path.starts_with("~/") {
        bail!("install_mise must be an absolute path or start with ~/: {path:?}");
    }
    if path.split('/').any(|component| component == "..") {
        bail!("install_mise must not contain '..': {path:?}");
    }
    if matches!(
        path.rsplit('/').next(),
        None | Some("") | Some(".") | Some("~")
    ) {
        bail!("install_mise must name an executable file: {path:?}");
    }
    Ok(())
}

fn validate_remote_executable(command: &str) -> Result<()> {
    validate_value("mise command", command)?;
    let is_path = command.contains('/');
    if command.starts_with('-')
        || command.contains(['\n', '\r'])

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Change the value to an absolute path such as /usr/local/bin/mise
  2. Or use a home-relative path like ~/.local/bin/mise
  3. If you need PATH-style lookup, resolve the absolute location of the binary first and configure that

Example fix

// before
install_mise = "bin/mise"
// after
install_mise = "~/.local/bin/mise"
Defensive patterns

Strategy: validation

Validate before calling

const isAddressable = (p) => typeof p === 'string' && (p.startsWith('/') || p.startsWith('~/'));

Type guard

const isAbsOrHomeRelative = (s) => typeof s === 'string' && (s.startsWith('/') || s.startsWith('~/'));

Try / catch

try { setInstallMisePath(p); } catch (e) { p = expandToAbsolute(p, remoteHome); setInstallMisePath(p); }

Prevention

When it happens

Trigger: Configuring install_mise with a relative path such as "bin/mise", a bare name like "mise", or a path that merely contains '~' but does not start with "~/" (e.g. "~user/bin/mise" fails only if it lacks the leading forms... any value not matching '/' or '~/' prefix).

Common situations: Users copying a local relative install location into remote config; assuming the remote CWD equals their home directory; writing "mise" expecting PATH lookup.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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