github/copilot-sdk · error
Unsupported Copilot CLI platform
Error message
Unsupported Copilot CLI platform: ${platform}-${arch}. What it means
After arch validation, getRuntimePlatform only accepts linux, darwin, and win32 platforms. Any other process.platform (freebsd, openbsd, aix, sunos, etc.) yields this error because the Copilot CLI ships no runtime for those systems.
Solutions
- Run the SDK on Linux, macOS, or Windows (x64/arm64).
- Use a Linux container (e.g. node:20-bookworm) on unsupported host OSes.
- If passing an explicit platform option, use one of: linux, linuxmusl, darwin, win32 combined with x64/arm64.
- Check for test/tooling stubs that override process.platform with unsupported values.
Example fix
// before
getRuntimePlatform("freebsd", "x64"); // throws
// after
getRuntimePlatform("linux", "x64"); // "linux-x64" Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED_PLATFORM = new Set(['linux', 'darwin', 'win32']);
if (!SUPPORTED_PLATFORM.has(process.platform)) throw new Error(`unsupported platform: ${process.platform}`); Type guard
function isSupportedPlatform(p: string): p is 'linux' | 'darwin' | 'win32' { return ['linux', 'darwin', 'win32'].includes(p); } Try / catch
try {
const platform = getRuntimePlatform();
} catch (e) {
if (e.message.startsWith('Unsupported Copilot CLI platform')) {
// run workload in a Linux container instead
} else throw e;
} Prevention
- Run the SDK only on Linux/macOS/Windows hosts.
- Use Linux containers on BSD/UNIX servers.
- Don't stub process.platform with unsupported values in tests that reach runtime resolution.
When it happens
Trigger: Calling platform()/getRuntimePlatform() on a BSD, AIX, Solaris, or otherwise unlisted OS, or passing a bogus custom platform string via options.
Common situations: Running the SDK on FreeBSD servers or AIX enterprise boxes, misconfigured container bases, tests passing fake platform values that aren't in the supported set.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- Unsupported Copilot CLI architecture
- Unsupported os.name: + osName
- Unsupported Copilot runtime platform
- The in-process runtime connection is closed.
- Failed to write a frame to the in-process runtime…
AI-assisted analysis of github/copilot-sdk@cd8cf15dc3 (2026-09-09).
Data as JSON: /api/errors/b5a9f946265ddfca.
Report an issue: GitHub.
Appendix: source
Thrown at nodejs/src/runtimeArtifacts.ts:232
| undefined;
return report?.header?.glibcVersionRuntime === undefined;
}
export function getRuntimePlatform(
platform = process.platform,
arch = process.arch,
musl = isMusl()
): string {
if (arch !== "x64" && arch !== "arm64") {
throw new Error(`Unsupported Copilot CLI architecture: ${arch}.`);
}
if (platform === "linux") {
return `${musl ? "linuxmusl" : "linux"}-${arch}`;
}
if (platform === "darwin" || platform === "win32") {
return `${platform}-${arch}`;
}
throw new Error(`Unsupported Copilot CLI platform: ${platform}-${arch}.`);
}
export function getRuntimeReleaseAssetName(version: string, platform: string): string {
return `github-copilot-${version}-${platform}.tgz`;
}
export function getRuntimePackageName(platform: string): string {
return `@github/copilot-sdk-${platform}`;
}
export function resolvePackageRoot(
packageName: string,
searchPaths = require.resolve.paths(packageName) ?? []
): string | undefined {
return searchPaths
.map((base) => join(base, ...packageName.split("/")))
.find((candidate) => existsSync(join(candidate, "package.json")));
}View on GitHub (pinned to cd8cf15dc3)