{"record":{"id":"aec7d945df89fa46","repo":"facebook/relay","slug":"platform-process-platform-process-arch-n","errorCode":null,"errorMessage":"Platform \"${process.platform} (${process.arch})\" not supported.","messagePattern":"Platform \"(.+?) \\((.+?)\\)\" not supported\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/relay-compiler/cli.js","lineNumber":23,"sourceCode":" * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @noflow\n * @oncall relay\n */\n\n'use strict';\n\nvar bin = require('./');\nvar spawn = require('child_process').spawn;\n\nvar input = process.argv.slice(2);\n\nif (bin !== null) {\n  spawn(bin, input, {stdio: 'inherit'}).on('exit', process.exit);\n} else {\n  throw new Error(\n    `Platform \"${process.platform} (${process.arch})\" not supported.`,\n  );\n}\n","sourceCodeStart":5,"sourceCodeEnd":27,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/packages/relay-compiler/cli.js#L5-L27","documentation":"relay-compiler ships platform-specific native binaries (via optional dependencies like relay-compiler-linux-x64). The CLI entry resolves the right binary for process.platform/process.arch; if none matches, it throws. This means either your platform/arch is genuinely unsupported or the binary package failed to install.","triggerScenarios":"Running the relay-compiler CLI on an OS/CPU without a published binary (e.g. FreeBSD, musl/alpine in older versions, ARM Windows); or when the platform-specific optional dependency was skipped (npm --no-optional, yarn bug with optionalDependencies, offline mirror, pnpm config) so `bin` resolves to null even on a supported platform.","commonSituations":"Docker alpine images; CI caching node_modules across platforms (macOS install used in linux container); npm/yarn installs that omit optional dependencies; unusual architectures like linux-arm64 on older relay-compiler versions.","solutions":["Reinstall dependencies so the platform binary package is fetched: delete node_modules + lockfile and run install without --no-optional / --ignore-scripts","Check your OS/arch against the published relay-compiler binaries; upgrade relay-compiler to a version supporting your platform (e.g. linux-arm64, musl)","If installing on alpine/musl, use a glibc image (e.g. node:XX-bookworm) or a relay-compiler version with musl builds","For truly unsupported platforms, run the compiler elsewhere (CI on supported OS) or use the JS API if available"],"exampleFix":"// Dockerfile before\nFROM node:18-alpine\n// after\nFROM node:18-bookworm-slim","handlingStrategy":"validation","validationCode":"import {existsSync} from 'fs';\n// ensure the optional platform binary package was installed\nconst pkg = `relay-compiler-${process.platform}-${process.arch}`;\nif (!existsSync(require.resolve(pkg + '/package.json'))) {\n  throw new Error('relay-compiler binary missing for ' + process.platform + '/' + process.arch);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never install with --no-optional / --ignore-optional","Don't reuse node_modules caches across OS/arch in CI","Use glibc-based Docker images for the compiler step","Keep relay-compiler updated for new platform (arm64/musl) support"],"tags":["cli","platform","native-binary","installation"],"backgroundTag":"unsupported-platform-binary","analyzedSha":"668b1b85e06261aa3b58dabfc51f8b5524a70955","analyzedAt":"2026-09-02T19:57:20.783Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}