{"record":{"id":"b4de2e88268703f1","repo":"cypress-io/cypress","slug":"unknown-component-name-componentname","errorCode":null,"errorMessage":"Unknown component name \"${componentName}\"","messagePattern":"Unknown component name \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/lib/cli.ts","lineNumber":198,"sourceCode":"  debug('parsed version arguments %o', opts)\n\n  const reportAllVersions = (versions: any): void => {\n    logger.always('Cypress package version:', versions.package)\n    logger.always('Cypress binary version:', versions.binary)\n    logger.always('Electron version:', versions.electronVersion)\n    logger.always('Bundled Node version:', versions.electronNodeVersion)\n  }\n\n  const reportComponentVersion = (componentName: string, versions: any): void => {\n    const names: any = {\n      package: 'package',\n      binary: 'binary',\n      electron: 'electronVersion',\n      node: 'electronNodeVersion',\n    }\n\n    if (!names[componentName]) {\n      throw new Error(`Unknown component name \"${componentName}\"`)\n    }\n\n    const name = names[componentName]\n\n    if (!versions[name]) {\n      throw new Error(`Cannot find version for component \"${componentName}\" under property \"${name}\"`)\n    }\n\n    const version = versions[name]\n\n    logger.always(version)\n  }\n\n  const defaultVersions = {\n    package: undefined,\n    binary: undefined,\n    electronVersion: undefined,\n    electronNodeVersion: undefined,","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/cypress-io/cypress/blob/0d85fdc91230885bca0a91df278312800a48b727/cli/lib/cli.ts#L180-L216","documentation":"Raised by reportComponentVersion() during `cypress version --component <name>` when the supplied component name is not one of the four known keys: 'package', 'binary', 'electron', or 'node'. The commander option is declared as `--component <package|binary|electron|node>`, so this fires when a user passes a value outside that enumerated set (commander does not enforce the placeholder enum).","triggerScenarios":"Running `cypress version --component foo`, `cypress version --component Electron` (wrong case), `cypress --component binaries`, or any other value not exactly matching package/binary/electron/node.","commonSituations":"Typing the component name; using wrong case (Electron vs electron); passing a plural (binaries); an older script assuming a different component name.","solutions":["Use one of the exact values: cypress version --component package | binary | electron | node.","Check spelling and case — the match is exact and case-sensitive.","Run `cypress version` with no --component to print all four versions at once."],"exampleFix":"# before: cypress version --component Electron\n# after: cypress version --component electron","handlingStrategy":"validation","validationCode":"const KNOWN = new Set(['package', 'binary', 'electron', 'node'])\n\nfunction assertComponent(name: string) {\n  if (!KNOWN.has(name)) {\n    throw new Error(`--component must be one of: ${[...KNOWN].join(', ')}`)\n  }\n}","typeGuard":"function isKnownComponent(c: string): c is 'package' | 'binary' | 'electron' | 'node' {\n  return c === 'package' || c === 'binary' || c === 'electron' || c === 'node'\n}","tryCatchPattern":null,"preventionTips":["Restrict --component to the four enumerated values before invoking the CLI.","Remember the value is case-sensitive.","Prefer `cypress version` (no flag) when you want all versions."],"tags":["cli","version","validation"],"backgroundTag":null,"analyzedSha":"0d85fdc91230885bca0a91df278312800a48b727","analyzedAt":"2026-08-12T16:24:28.056Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}