can1357/oh-my-pi · error · Error

mise install --force failed with exit code ${forceResult.exi

Error message

mise install --force failed with exit code ${forceResult.exitCode}

What it means

Thrown in updateViaMise when the `--force` path is requested and the follow-up forced install (`mise install --force ...` via buildMiseForceInstallArgs) exits non-zero. This runs only when force is set, after a successful `mise upgrade`, to guarantee the exact expected version is installed.

Source

Thrown at packages/coding-agent/src/cli/update-cli.ts:1684

		throw new Error(`brew ${args[0]} failed with exit code ${result.exitCode}`);
	}

	await printVerification(expectedVersion);
}

async function updateViaMise(expectedVersion: string, force: boolean): Promise<void> {
	console.log(chalk.dim("Updating via mise..."));
	const args = buildMiseUpgradeArgs();
	const result = await $`mise ${args}`.nothrow();
	if (result.exitCode !== 0) {
		throw new Error(`mise upgrade failed with exit code ${result.exitCode}`);
	}

	if (force) {
		const forceArgs = buildMiseForceInstallArgs(expectedVersion);
		const forceResult = await $`mise ${forceArgs}`.nothrow();
		if (forceResult.exitCode !== 0) {
			throw new Error(`mise install --force failed with exit code ${forceResult.exitCode}`);
		}
	}

	await printVerification(expectedVersion);
}

// Monotonic within this process so two updates started in the same millisecond
// (same pid, same `Date.now()`) still get distinct temp/backup paths. Kept
// numeric so the artifact sweep's `\d+(\.\d+)*` matcher still reclaims them.
let updateAttemptSeq = 0;

/**
 * Download a release binary to a target path, replacing an existing file.
 */
export async function updateViaBinaryAt(
	targetPath: string,
	expectedVersion: string,
	options: {

View on GitHub (pinned to 9690622007)

Solutions

  1. Run the forced install manually to see mise's error output
  2. Check the version exists for your platform (`mise ls-remote <tool>`)
  3. Clear the mise installs cache for the tool and retry
  4. Fix permissions on MISE_DATA_DIR/installs directory
  5. Drop --force and retry a normal `mise upgrade`

Example fix

// before
const forceResult = await $`mise ${forceArgs}`.nothrow();
if (forceResult.exitCode !== 0) {
	throw new Error(`mise install --force failed with exit code ${forceResult.exitCode}`);
}
// after
const forceResult = await $`mise ${forceArgs}`.nothrow();
if (forceResult.exitCode !== 0) {
	throw new Error(`mise install --force failed (${forceResult.exitCode}): ${forceResult.stderr.text()}`);
}
Defensive patterns

Strategy: validation

Validate before calling

const remote = await $`mise ls-remote ${tool}`.nothrow();
if (!remote.text().split("\n").includes(expectedVersion)) {
	throw new Error(`${expectedVersion} not available for mise install --force`);
}

Prevention

When it happens

Trigger: User runs self-update with --force on a mise install and `mise <force-install args>` fails — the target version is not available for the platform, source build fails, or the tool prefix directory is not writable.

Common situations: Expected version not published for the current OS/arch; corrupted mise installs directory (~/.local/share/mise); plugin compile failure on forced reinstall.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/e7e4a343ec2cdfca. Report an issue: GitHub.