jdx/mise · error

deps run command cannot be empty

Error message

deps run command cannot be empty

What it means

`DepsCommand::from_string` converts a textual `run` command from a deps provider config into an executable command. If the string is empty (or only whitespace), there is nothing to execute, so mise rejects it at parse time.

Solutions

  1. Set a non-empty `run` command string in the deps provider config
  2. If the value is interpolated, ensure the variable resolves to a real command
  3. Remove the provider entry entirely if no run command is needed

Example fix

// before (mise.toml)
[deps.providers.mine]
run = ""
// after
[deps.providers.mine]
run = "cargo add {{packages}}"
Defensive patterns

Strategy: validation

Validate before calling

if run.trim().is_empty() {
    return Err("deps provider 'run' must be a non-empty command");
}

Prevention

When it happens

Trigger: A deps provider entry's `run` field is `""` or whitespace when `from_string` parses the provider config.

Common situations: Hand-editing mise.toml and leaving `run = ""`; templated/interpolated config where a variable expands to empty; copy-paste that dropped the command.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/888315e0086d5733. Report an issue: GitHub.

Appendix: source

Thrown at src/deps/mod.rs:138

    pub env: BTreeMap<String, String>,
    /// Working directory (defaults to project root)
    pub cwd: Option<PathBuf>,
    /// Human-readable description of what this command does
    pub description: String,
}

impl DepsCommand {
    /// Create a DepsCommand from a run string like "npm install"
    ///
    /// Wraps the command with `sh -c` (matching task execution behavior)
    /// so shell features like pipes, redirects, and `&&` work.
    pub(crate) fn from_string(
        run: &str,
        project_root: &Path,
        config: &rule::DepsProviderConfig,
    ) -> Result<Self> {
        if run.trim().is_empty() {
            bail!("deps run command cannot be empty");
        }

        let shell = Settings::get().default_inline_shell()?;
        let (program, shell_args) = shell.split_first().ok_or_else(|| {
            eyre::eyre!("default inline shell is empty; check unix_default_inline_shell_args / windows_default_inline_shell_args")
        })?;

        let mut args: Vec<String> = shell_args.to_vec();
        args.push(run.to_string());

        Ok(Self {
            inline: true,
            program: program.to_string(),
            args,
            env: config.env.clone(),
            cwd: config
                .dir
                .as_ref()

View on GitHub (pinned to 533346cc37)