can1357/oh-my-pi · error · Error

Unsupported architecture: ${arch}

Error message

Unsupported architecture: ${arch}

What it means

Thrown when mapping the running CPU architecture (process.arch) to a release asset name and the arch is not x64 or arm64. The binary release channel only publishes assets for these two architectures.

Source

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

			os = "darwin";
			break;
		case "win32":
			os = "windows";
			break;
		default:
			throw new Error(`Unsupported platform: ${platform}`);
	}

	let archName: string;
	switch (arch) {
		case "x64":
			archName = "x64";
			break;
		case "arm64":
			archName = "arm64";
			break;
		default:
			throw new Error(`Unsupported architecture: ${arch}`);
	}

	if (os === "windows") {
		return `${APP_NAME}-${os}-${archName}.exe`;
	}
	return `${APP_NAME}-${os}-${archName}`;
}

/**
 * Resolve the path that `omp` maps to in the user's PATH.
 */
function resolveOmpPath(): string | undefined {
	return $which(APP_NAME) ?? undefined;
}

/**
 * Parse the version a launcher reports from `omp --version` output
 * (`omp/X.Y.Z`, or a prerelease such as `omp/X.Y.Z-canary.1`).

View on GitHub (pinned to 9690622007)

Solutions

  1. Install/update via npm/bun instead of the binary channel: npm install -g <pkg>
  2. Build from source on the unsupported architecture
  3. Run x64 binaries under an emulator (box64/rosetta-style) if the platform provides one
  4. Verify with `node -p process.arch` and request the architecture upstream if widely needed

Example fix

// before (riscv64 board)
omp update  // Unsupported architecture: riscv64
// after
bun install -g @oh-my-pi/pi-coding-agent@latest
Defensive patterns

Strategy: validation

Validate before calling

const supportedArchs = new Set(["x64", "arm64"]);
if (!supportedArchs.has(process.arch)) {
  console.error(`No binary release for ${process.arch}; use npm/bun install instead.`);
}

Try / catch

try {
  await runUpdate();
} catch (err) {
  if (String(err?.message).startsWith("Unsupported architecture:")) {
    console.error("Binary updates unsupported on this arch; install via npm/bun.");
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: Running `omp update` on a machine whose process.arch is not "x64" or "arm64" — e.g. ia32, ppc64, s390x, riscv64, or mips.

Common situations: Older 32-bit Linux installs, POWER/Z mainframe Linux, RISC-V dev boards, or emulation environments reporting unusual arch values.

Related errors


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