{"record":{"id":"b5a9f946265ddfca","repo":"github/copilot-sdk","slug":"unsupported-copilot-cli-platform-platform-ar","errorCode":null,"errorMessage":"Unsupported Copilot CLI platform: ${platform}-${arch}.","messagePattern":"Unsupported Copilot CLI platform: (.+?)-(.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodejs/src/runtimeArtifacts.ts","lineNumber":232,"sourceCode":"        | undefined;\n    return report?.header?.glibcVersionRuntime === undefined;\n}\n\nexport function getRuntimePlatform(\n    platform = process.platform,\n    arch = process.arch,\n    musl = isMusl()\n): string {\n    if (arch !== \"x64\" && arch !== \"arm64\") {\n        throw new Error(`Unsupported Copilot CLI architecture: ${arch}.`);\n    }\n    if (platform === \"linux\") {\n        return `${musl ? \"linuxmusl\" : \"linux\"}-${arch}`;\n    }\n    if (platform === \"darwin\" || platform === \"win32\") {\n        return `${platform}-${arch}`;\n    }\n    throw new Error(`Unsupported Copilot CLI platform: ${platform}-${arch}.`);\n}\n\nexport function getRuntimeReleaseAssetName(version: string, platform: string): string {\n    return `github-copilot-${version}-${platform}.tgz`;\n}\n\nexport function getRuntimePackageName(platform: string): string {\n    return `@github/copilot-sdk-${platform}`;\n}\n\nexport function resolvePackageRoot(\n    packageName: string,\n    searchPaths = require.resolve.paths(packageName) ?? []\n): string | undefined {\n    return searchPaths\n        .map((base) => join(base, ...packageName.split(\"/\")))\n        .find((candidate) => existsSync(join(candidate, \"package.json\")));\n}","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/nodejs/src/runtimeArtifacts.ts#L214-L250","documentation":"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.","triggerScenarios":"Calling platform()/getRuntimePlatform() on a BSD, AIX, Solaris, or otherwise unlisted OS, or passing a bogus custom platform string via options.","commonSituations":"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.","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."],"exampleFix":"// before\ngetRuntimePlatform(\"freebsd\", \"x64\"); // throws\n\n// after\ngetRuntimePlatform(\"linux\", \"x64\"); // \"linux-x64\"","handlingStrategy":"validation","validationCode":"const SUPPORTED_PLATFORM = new Set(['linux', 'darwin', 'win32']);\nif (!SUPPORTED_PLATFORM.has(process.platform)) throw new Error(`unsupported platform: ${process.platform}`);","typeGuard":"function isSupportedPlatform(p: string): p is 'linux' | 'darwin' | 'win32' { return ['linux', 'darwin', 'win32'].includes(p); }","tryCatchPattern":"try {\n  const platform = getRuntimePlatform();\n} catch (e) {\n  if (e.message.startsWith('Unsupported Copilot CLI platform')) {\n    // run workload in a Linux container instead\n  } else throw e;\n}","preventionTips":["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."],"tags":["platform","unsupported-os","nodejs"],"backgroundTag":"unsupported-platform","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}