can1357/oh-my-pi · error · Error

Unsupported platform: ${platform}

Error message

Unsupported platform: ${platform}

What it means

Thrown when mapping the running OS (process.platform) to the binary-release OS name (linux/darwin/windows) and the platform is not one of the three the updater ships binaries for. It prevents attempting to download an asset that does not exist.

Source

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

 * Get the appropriate binary name for this platform.
 */
function getBinaryName(): string {
	const platform = process.platform;
	const arch = process.arch;

	let os: string;
	switch (platform) {
		case "linux":
			os = isMuslLinux() ? "linux-musl" : "linux";
			break;
		case "darwin":
			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}`;

View on GitHub (pinned to 9690622007)

Solutions

  1. Update via the system package manager or build from source instead of the binary updater
  2. Run omp on a supported platform (Linux, macOS, Windows)
  3. Install via npm/bun (npm install -g <pkg>) which uses the JS entry rather than platform binaries
  4. Check `node -p process.platform` to confirm the detected platform and file an issue if it should be supported

Example fix

// before (FreeBSD)
omp update  // Unsupported platform: freebsd
// after
npm install -g @oh-my-pi/pi-coding-agent@latest
Defensive patterns

Strategy: validation

Validate before calling

const supportedPlatforms = new Set(["linux", "darwin", "win32"]);
if (!supportedPlatforms.has(process.platform)) {
  console.error(`No binary release for ${process.platform}; use npm/bun install instead.`);
}

Try / catch

try {
  await runUpdate();
} catch (err) {
  if (String(err?.message).startsWith("Unsupported platform:")) {
    console.error("Binary updates unsupported here; install via npm instead.");
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: Running `omp update` on a process.platform value outside "linux"|"darwin"|"win32" — e.g. freebsd, openbsd, aix, sunos, android, or a hypothetical browser/edge runtime.

Common situations: Developer running omp on FreeBSD/OpenBSD (Bun runs there without official omp binaries), termux/Android, or invoking the updater from an unusual embedded runtime.

Related errors


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