{"record":{"id":"6ae7ebc3b497d7bf","repo":"openai/codex","slug":"unsupported-platform-process-platform-proce","errorCode":null,"errorMessage":"Unsupported platform: ${process.platform} (${process.arch})","messagePattern":"Unsupported platform: (.+?) \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"codex-rs/responses-api-proxy/npm/bin/codex-responses-api-proxy.js","lineNumber":46,"sourceCode":"      }\n      break;\n    case \"win32\":\n      if (arch === \"x64\") {\n        return \"x86_64-pc-windows-msvc\";\n      }\n      if (arch === \"arm64\") {\n        return \"aarch64-pc-windows-msvc\";\n      }\n      break;\n    default:\n      break;\n  }\n  return null;\n}\n\nconst targetTriple = determineTargetTriple(process.platform, process.arch);\nif (!targetTriple) {\n  throw new Error(\n    `Unsupported platform: ${process.platform} (${process.arch})`,\n  );\n}\n\nconst vendorRoot = path.join(__dirname, \"..\", \"vendor\");\nconst archRoot = path.join(vendorRoot, targetTriple);\nconst binaryBaseName = \"codex-responses-api-proxy\";\nconst binaryPath = path.join(\n  archRoot,\n  binaryBaseName,\n  process.platform === \"win32\" ? `${binaryBaseName}.exe` : binaryBaseName,\n);\n\nconst child = spawn(binaryPath, process.argv.slice(2), {\n  stdio: \"inherit\",\n});\n\nchild.on(\"error\", (err) => {","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/responses-api-proxy/npm/bin/codex-responses-api-proxy.js#L28-L64","documentation":"The npm launcher maps Node's process.platform and process.arch to a Rust target triple to locate the vendored native binary under vendor/<triple>/codex-responses-api-proxy. Only linux/android, darwin, and win32 on x64 or arm64 are mapped; on any other combination determineTargetTriple returns null and the launcher throws before spawning the binary.","triggerScenarios":"Running the package on Node where (platform, arch) is outside the matrix: linux ia32 (32-bit x86), linux arm (32-bit ARM such as armv7l), freebsd/openbsd/sunos/aix, or any arch string other than x64/arm64.","commonSituations":"32-bit Node installations; BSD or Solaris hosts; Raspberry Pi 32-bit userspace; installing the package on all machines via a lockfile without os/cpu filters, so the launcher lands where no binary is vendored.","solutions":["Run under 64-bit Node (x64 or arm64) on Linux, macOS, or Windows - these cover every vendored triple","If Node is 32-bit, reinstall a 64-bit Node distribution","Build from source with cargo build -p codex-responses-api-proxy and invoke the binary directly, bypassing the launcher","Add os/cpu constraints to package.json or request a vendored build for the missing triple"],"exampleFix":"// package.json - stop installs on unsupported hosts\n\"cpu\": [\"x64\", \"arm64\"],\n\"os\": [\"linux\", \"darwin\", \"win32\"]","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(['linux-x64','linux-arm64','android-x64','android-arm64','darwin-x64','darwin-arm64','win32-x64','win32-arm64']);\nconst key = `${process.platform}-${process.arch}`;\nif (!SUPPORTED.has(key)) {\n  console.error(`no vendored codex-responses-api-proxy binary for ${key}`);\n  process.exit(1);\n}","typeGuard":"function isSupportedTarget(platform = process.platform, arch = process.arch) {\n  const osOk = ['linux', 'android', 'darwin', 'win32'].includes(platform);\n  const archOk = ['x64', 'arm64'].includes(arch);\n  return osOk && archOk;\n}","tryCatchPattern":"try {\n  await import('codex-responses-api-proxy/npm/bin/codex-responses-api-proxy.js');\n} catch (e) {\n  if (/^Unsupported platform/.test(e.message)) {\n    console.error('fall back to a from-source or PATH-installed binary');\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Declare cpu and os fields in package.json so npm skips unsupported hosts","Check platform/arch in install scripts before using the package","Document a from-source build path for exotic platforms"],"tags":["node","npm","platform-support","native-binary"],"backgroundTag":"unsupported-platform-arch","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}