{"record":{"id":"fc66650e14159224","repo":"microsoft/playwright","slug":"unsupported-platform-process-platform","errorCode":null,"errorMessage":"Unsupported platform: ${process.platform}","messagePattern":"Unsupported platform: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/registry/index.ts","lineNumber":384,"sourceCode":"    'mac13-arm64': undefined,\n    'mac14': 'builds/android/%s/android.zip',\n    'mac14-arm64': 'builds/android/%s/android.zip',\n    'mac15': 'builds/android/%s/android.zip',\n    'mac15-arm64': 'builds/android/%s/android.zip',\n    'mac26': 'builds/android/%s/android.zip',\n    'mac26-arm64': 'builds/android/%s/android.zip',\n    'win64': 'builds/android/%s/android.zip',\n  },\n};\n\nfunction computeDefaultCacheDirectory(): string {\n  if (process.platform === 'linux')\n    return process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache');\n  if (process.platform === 'darwin')\n    return path.join(os.homedir(), 'Library', 'Caches');\n  if (process.platform === 'win32')\n    return process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local');\n  throw new Error('Unsupported platform: ' + process.platform);\n}\n\nlet _defaultCacheDirectory: string | undefined;\n\nexport function defaultCacheDirectory(): string {\n  return _defaultCacheDirectory ??= computeDefaultCacheDirectory();\n}\n\nexport function defaultRegistryDirectory(): string {\n  return path.join(defaultCacheDirectory(), 'ms-playwright');\n}\n\nexport const registryDirectory = (() => {\n  let result: string;\n\n  const envDefined = getFromENV('PLAYWRIGHT_BROWSERS_PATH');\n  if (envDefined === '0')\n    result = path.join(packageRoot, '.local-browsers');","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/registry/index.ts#L366-L402","documentation":"Thrown by computeDefaultCacheDirectory when process.platform is not linux, darwin, or win32. Playwright only knows how to compute a default cache directory (where browsers are stored) on those three platforms; any other platform (freebsd, aix, sunos, etc.) is rejected rather than guessing a path.","triggerScenarios":"Running Playwright on an unsupported OS (e.g. FreeBSD, OpenBSD, AIX, SmartOS); a misreported platform due to a custom Node build; running in an unusual emulated environment that reports a different platform string.","commonSituations":"Trying to run browsers on FreeBSD/AIX; container or emulation layers that alter process.platform; forks of Node that report a non-standard platform.","solutions":["Run on a supported platform (Linux, macOS, Windows), ideally via the official Playwright Docker image on Linux.","If you must use another platform, set the PLAYWRIGHT_BROWSERS_PATH (cache) and registry env vars explicitly, but browser binaries may still not be provided for that platform.","Verify process.platform is reported correctly; if a custom Node build misreports it, use a standard Node build."],"exampleFix":"# use a supported platform / official image\nFROM mcr.microsoft.com/playwright:v1.0.0-jammy\n# or set cache path explicitly (binaries must still exist for the platform)\nPLAYWRIGHT_BROWSERS_PATH=/opt/pw-browsers","handlingStrategy":"validation","validationCode":"const supported = new Set(['linux', 'darwin', 'win32']);\nif (!supported.has(process.platform))\n  throw new Error(`Unsupported platform ${process.platform}; use Linux/macOS/Windows or the official image`);","typeGuard":"function isSupportedPlatform(p: string): p is 'linux' | 'darwin' | 'win32' {\n  return p === 'linux' || p === 'darwin' || p === 'win32';\n}","tryCatchPattern":null,"preventionTips":["Run Playwright on Linux, macOS, or Windows only.","Use the official Playwright Docker image on unsupported host OSes.","Verify process.platform is reported correctly by your Node runtime."],"tags":["platform","unsupported","cache","registry","system"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}