can1357/oh-my-pi · error · Error

install of ${release.packages.pkg} failed with exit code ${i

Error message

install of ${release.packages.pkg} failed with exit code ${installExit}; the existing install was left untouched

What it means

Thrown by `migrateRenamedInstall` when the npm package has been renamed and the migration's install step (installing the new package name) exits with a non-zero code. The updater aborts deliberately without touching the existing working install.

Source

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

}

/**
 * Migrate a package-manager install across an `omp.rename` hop without a
 * window where no working `omp` exists:
 *
 * 1. Install the new package FIRST. Nothing has been removed yet, so a
 *    failure here leaves the old install fully functional.
 * 2. Remove the old-name globals. Failure is non-fatal: a stale package
 *    wastes disk, but the bin already points at the new install.
 * 3. Verify the PATH-resolved `omp`. If the removal deleted the shared bin
 *    link (manager-dependent), re-run the idempotent install to restore it
 *    and verify again; only a repeated failure aborts, with a recovery hint.
 */
export async function migrateRenamedInstall(release: ReleaseInfo, steps: RenameMigrationSteps): Promise<void> {
	console.log(chalk.dim(`npm package renamed to ${release.packages.pkg}; migrating this install.`));
	const installExit = await steps.install();
	if (installExit !== 0) {
		throw new Error(
			`install of ${release.packages.pkg} failed with exit code ${installExit}; the existing install was left untouched`,
		);
	}

	const removeExit = await steps.removeOld();
	if (removeExit !== 0) {
		console.log(chalk.yellow(`Warning: could not remove the old ${PACKAGE} package; remove it manually later.`));
	}

	let verification = await steps.verify();
	if (!verification.ok) {
		// Removing the old package may have taken the shared bin link with it;
		// reinstalling the new package restores the link.
		if ((await steps.install()) === 0) {
			verification = await steps.verify();
		}
	}
	if (!verification.ok) {

View on GitHub (pinned to 9690622007)

Solutions

  1. Run the install step manually to see the real npm error: npm install -g <new-pkg>
  2. Fix npm global prefix permissions (use a user-owned prefix or nvm/volta-managed node)
  3. Ensure the registry is reachable and any required auth (npm login) is set up
  4. After fixing, re-run `omp update` which will retry the migration; the old install is intact
Defensive patterns

Strategy: try-catch

Validate before calling

// verify npm can install globally before starting the migration
npm ping && npm config get prefix

Try / catch

try {
  await runUpdate();
} catch (err) {
  if (String(err?.message).includes("failed with exit code")) {
    console.error("Migration install failed; existing install untouched. Run `npm install -g <new-pkg>` manually to see the error.");
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: `steps.install()` (e.g. `npm install -g <new-pkg>` run as a subprocess) returns a non-zero exit code during the rename migration flow.

Common situations: npm permissions issues (EACCES on the global prefix), registry auth required for the new package, no network, npm not on PATH in the migration environment, or disk full.

Related errors


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