jdx/mise · error
`mise lock --upgrade` cannot be combined with tool arguments
Error message
`mise lock --upgrade` cannot be combined with tool arguments
What it means
`mise lock` has two mutually exclusive modes: updating lockfiles for explicitly given tools, or --upgrade which re-locks everything. Passing tool arguments together with --upgrade is contradictory, so mise bails immediately before doing any work.
Source
Thrown at src/cli/lock.rs:281
fn classify_lock_result(
resolution_error: Option<String>,
error_is_fatal: bool,
applied: bool,
) -> (LockTaskStatus, Option<String>) {
if let Some(error) = resolution_error.filter(|_| error_is_fatal) {
(LockTaskStatus::Failed, Some(error))
} else if applied {
(LockTaskStatus::Updated, None)
} else {
(LockTaskStatus::Unresolved, None)
}
}
impl Lock {
pub(crate) async fn run(self) -> Result<()> {
if self.upgrade && !self.tool.is_empty() {
bail!("`mise lock --upgrade` cannot be combined with tool arguments");
}
let settings = Settings::get();
let config = Config::get().await?;
if !self.dry_run && !self.upgrade {
lockfile::migrate_monorepo_lockfiles(&config, self.upgrade)?;
}
let before_date = self.get_before_date()?;
let lock_resolve_options = ResolveOptions {
before_date,
filter_installed_versions_by_release_date: true,
latest_versions: self.bump,
use_locked_version: !self.bump,
// Lock moving channels to their current concrete value without making
// ordinary `latest` requests ignore an installed concrete version.
resolve_rolling_channels: true,
..Default::default()
};
let monorepo_union = if !self.global && config.monorepo_lockfile_root().is_some() {View on GitHub (pinned to afd2eddd3a)
Solutions
- Drop --upgrade to lock only the named tools: `mise lock node python`.
- Drop the tool arguments to upgrade every tool in the lockfile: `mise lock --upgrade`.
- Run both if needed: `mise lock --upgrade` followed by targeted `mise lock <tool>` calls.
Example fix
// before mise lock --upgrade node // after (choose one) mise lock node # lock only node # or mise lock --upgrade # upgrade all locked tools
Defensive patterns
Strategy: validation
Validate before calling
# shell: pick one mode before running if [ "$MODE" = upgrade ]; then mise lock --upgrade; else mise lock "$@"; fi
Prevention
- Remember --upgrade is global: it never takes tool arguments.
- For targeted relocks, omit --upgrade and list tools explicitly.
- Wrap lock invocations in scripts that enforce the flag combination.
When it happens
Trigger: Running `mise lock --upgrade <tool>` (e.g. `mise lock --upgrade node`) — self.upgrade is true while self.tool is non-empty.
Common situations: Users assuming --upgrade scopes to the named tools the way other mise commands accept tool arguments; scripted aliases combining flags; misreading --upgrade as "upgrade these tools" rather than "upgrade all locked tools".
Related errors
- {}@{requested} is not installed{resolved} hint: run `mise in
- No executable found for configured tool: {bin_name} The inst
- {bin_name} is a mise bin however it is not currently active.
- bootstrap command is registered
- GitHub relay request denied or unavailable
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/dff54da7219661c9.
Report an issue: GitHub.