jdx/mise · error
{msg}
Error message
{msg} What it means
This is the terminal failure of `mise exec` / `mise x`: the final `exec(2)` of the resolved program returned, which only happens when exec fails. The message is `"<program>" <os error>` (e.g. `"npm" No such file or directory`), and when PATH resolution already failed, mise appends a hint naming installed-but-unconfigured tools that provide the binary — because `mise install` writes no config file, those tool dirs never join the PATH mise builds (discussion #4407).
Source
Thrown at src/cli/exec.rs:424
if let Some(sandboxed) = sandbox.apply(&program.to_string_lossy(), &args_str).await? {
// macOS: exec through sandbox-exec
let err = exec::Command::new(&sandboxed.program)
.args(&sandboxed.args)
.exec();
bail!("{} {err}", sandboxed.program);
}
let err = exec::Command::new(program.clone()).args(&args).exec();
let mut msg = format!("{:?} {err}", program.to_string_lossy());
// The bin never resolved on PATH. If an installed-but-unconfigured tool
// would have provided it, say so instead of leaving the user with a bare
// ENOENT (discussion #4407).
if resolution_failed && let Some(hint) = crate::shims::exec_resolution_hint(&program_name).await
{
msg.push_str("\n\n");
msg.push_str(&hint);
}
bail!("{msg}")
}
/// The opaque `cannot find binary path`, plus an explanation when an
/// installed-but-unconfigured tool would have provided the bin. `mise install`
/// writes to no config file, so its tool dirs never join the PATH `mise exec`
/// builds (discussion #4407).
#[cfg(all(windows, not(test)))]
async fn err_cannot_find_binary_path(program_name: &str) -> eyre::Report {
let base: eyre::Report = which::Error::CannotFindBinaryPath.into();
match crate::shims::exec_resolution_hint(program_name).await {
Some(hint) => eyre!("{base}\n\n{hint}"),
None => base,
}
}
#[cfg(all(windows, not(test)))]
pub(crate) async fn exec_program<T, U>(
program: T,View on GitHub (pinned to 6f52dcdf99)
Solutions
- Follow the appended hint if present: add the tool to config with `mise use node` so its bin dir joins the exec PATH
- Install and record the tool: `mise use -g <tool>` or `mise use <tool>` then retry
- Verify the binary resolves first with `mise which <program>`; if the error is EACCES, `chmod +x` the binary
- If ENOEXEC, add a shebang or invoke through the right interpreter
Example fix
# before $ mise install node # installs but writes no config $ mise x -- npm -v Error: "npm" No such file or directory # after $ mise use node # records node in mise.toml $ mise x -- npm -v
Defensive patterns
Strategy: fallback
Validate before calling
# Resolve before exec; install/use the tool if missing mise which "$PROG" >/dev/null 2>&1 || mise use "$TOOL" mise x -- "$PROG" "$@"
Try / catch
if ! mise x -- "$PROG" "$@"; then echo "mise exec failed for $PROG" >&2; mise which "$PROG" || mise use "$TOOL"; exit 1; fi
Prevention
- Prefer `mise use` over bare `mise install` so tools join the exec PATH
- Probe with `mise which <bin>` in scripts before exec'ing
- Read the appended hint — it names the installed-but-unconfigured tool
When it happens
Trigger: `mise exec -- cargo build` where cargo is not on any PATH entry mise constructed; or exec fails with EACCES/ENOEXEC/E2BIG for a found binary. The hint branch triggers only when `which` resolution failed (`resolution_failed = true`) and `shims::exec_resolution_hint` finds an installed tool that ships the bin.
Common situations: Installing a tool with `mise install node` without adding it to mise.toml, then `mise x -- npm ...`; shebang-less scripts (ENOEXEC); missing execute bits; a tool installed for the wrong OS/arch so exec rejects it.
Related errors
- {} {err}
- container engine command 'docker' was not found; set engine_
- {kind} returned an unsafe absolute path: {path:?}
- trimPrefix requires exactly 2 arguments
- trimSuffix requires exactly 2 arguments
AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22).
Data as JSON: /api/errors/1844f678c41b5c75.
Report an issue: GitHub.