cypress-io/cypress · critical · Error
Platform: "${platform}" is not supported.
Error message
Platform: "${platform}" is not supported. What it means
Raised by getPlatformExecutable() when os.platform() returns a value other than 'darwin', 'linux', or 'win32'. The Cypress desktop binary only ships executable layouts for those three platforms, so the function cannot compute the path to the binary entry point (e.g. Contents/MacOS/Cypress, Cypress, Cypress.exe). The TODO comment notes this is not yet using Cypress's standard error format.
Source
Thrown at cli/lib/tasks/state.ts:20
import os from 'os'
import path from 'path'
import untildify from 'untildify'
import Debug from 'debug'
import { cwd } from 'process'
import fs from 'fs-extra'
import util from '../util'
const debug = Debug('cypress:cli')
const getPlatformExecutable = (): string => {
const platform = os.platform()
switch (platform) {
case 'darwin': return 'Contents/MacOS/Cypress'
case 'linux': return 'Cypress'
case 'win32': return 'Cypress.exe'
// TODO handle this error using our standard
default: throw new Error(`Platform: "${platform}" is not supported.`)
}
}
const getPlatFormBinaryFolder = (): string => {
const platform = os.platform()
switch (platform) {
case 'darwin': return 'Cypress.app'
case 'linux': return 'Cypress'
case 'win32': return 'Cypress'
// TODO handle this error using our standard
default: throw new Error(`Platform: "${platform}" is not supported.`)
}
}
const getBinaryPkgPath = (binaryDir: string): string => {
const platform = os.platform()
View on GitHub (pinned to 0d85fdc912)
Solutions
- Run Cypress on a supported OS: macOS, Linux, or Windows. For other Unix systems, use the Linux build inside a compatible emulation/container if licensing allows.
- Confirm the platform with `node -e "console.log(require('os').platform())"` and ensure it reports darwin, linux, or win32.
- If you hit this inside CI, switch the runner image to a supported OS.
Example fix
# before: running on FreeBSD (os.platform() === 'freebsd') # after: run the job on a linux runner image
Defensive patterns
Strategy: validation
Validate before calling
import os from 'os'
const platform = os.platform()
const supported = new Set(['darwin', 'linux', 'win32'])
if (!supported.has(platform)) {
throw new Error(`Unsupported platform ${platform}; Cypress runs on macOS, Linux, or Windows.`)
} Type guard
function isSupportedPlatform(p: string): p is 'darwin' | 'linux' | 'win32' {
return p === 'darwin' || p === 'linux' || p === 'win32'
} Prevention
- Gate Cypress usage on os.platform() being darwin/linux/win32 before invoking install or run.
- Choose CI runner images that report a supported platform.
- Fail fast in your own setup script rather than letting Cypress throw deep in state resolution.
When it happens
Trigger: Running any Cypress command that needs the binary path on a Node build whose process.platform is something like 'aix', 'sunos', 'freebsd', or 'openbsd'. Also triggered by test environments that mock os.platform() to an unsupported value.
Common situations: Attempting to run Cypress on an unsupported OS (e.g. FreeBSD, SmartOS); a misconfigured container/VM reporting a nonstandard platform; running under a Node runtime that reports a platform string Cypress does not recognize.
Related errors
AI-assisted analysis of cypress-io/cypress@0d85fdc912 (2026-08-12).
Data as JSON: /api/errors/e1ee1b48d7f8b626.
Report an issue: GitHub.