{"record":{"id":"8a87ff4b03bd1efd","repo":"affaan-m/ECC","slug":"unknown-install-target-target-expected-one-of","errorCode":null,"errorMessage":"Unknown install target: ${target}. Expected one of ${SUPPORTED_INSTALL_TARGETS.join(', ')}","messagePattern":"Unknown install target: (.+?)\\. Expected one of (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/install-executor.js","lineNumber":80,"sourceCode":"function listAvailableLanguages(sourceRoot = getSourceRoot()) {\n  return [...new Set([...listLegacyCompatibilityLanguages(), ...readDirectoryNames(path.join(sourceRoot, 'rules')).filter(name => name !== 'common')])].sort();\n}\n\nfunction validateLegacyTarget(target) {\n  if (LEGACY_INSTALL_TARGETS.includes(target)) {\n    return;\n  }\n  // A target can be fully supported yet not installable via the bare-language\n  // positional syntax (which is legacy-only). Guide the user to the right mode\n  // instead of implying the target is unknown (#2282).\n  if (SUPPORTED_INSTALL_TARGETS.includes(target)) {\n    throw new Error(\n      `Target '${target}' is supported, but the bare-language install syntax only accepts ${LEGACY_INSTALL_TARGETS.join(', ')}. ` +\n        `Install '${target}' with a component selection instead, e.g. \\`install.sh --target ${target} --profile full\\` ` +\n        `(or --modules <id,...> / --skills <id,...>).`\n    );\n  }\n  throw new Error(`Unknown install target: ${target}. Expected one of ${SUPPORTED_INSTALL_TARGETS.join(', ')}`);\n}\n\nconst IGNORED_DIRECTORY_NAMES = new Set(['node_modules', '.git']);\n\nfunction listFilesRecursive(dirPath) {\n  if (!fs.existsSync(dirPath)) {\n    return [];\n  }\n\n  const files = [];\n  const entries = fs.readdirSync(dirPath, { withFileTypes: true });\n\n  for (const entry of entries) {\n    const absolutePath = path.join(dirPath, entry.name);\n    if (entry.isDirectory()) {\n      if (IGNORED_DIRECTORY_NAMES.has(entry.name)) {\n        continue;\n      }","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/install-executor.js#L62-L98","documentation":"Thrown by validateLegacyTarget() when the target is neither in LEGACY_INSTALL_TARGETS nor in SUPPORTED_INSTALL_TARGETS — i.e. genuinely unknown. The message lists every supported target so the user can pick a valid one.","triggerScenarios":"validateLegacyTarget('foo'), validateLegacyTarget(''), or any typo that does not appear in SUPPORTED_INSTALL_TARGETS = [claude, claude-project, cursor, antigravity, codex, gemini, opencode, codebuddy, joycode, qwen, zed, hermes, openclaw, kimi].","commonSituations":"Typo (e.g. 'claudeproj' instead of 'claude-project'); stale docs naming a removed target; user invents a harness name; trailing whitespace or wrong casing in the positional argument.","solutions":["Compare against the list in the error message and correct the spelling/casing.","Run the install with --target to see the same validation set, or list targets programmatically: console.log(require('./install-manifests').SUPPORTED_INSTALL_TARGETS).","Trim whitespace from the positional argument before passing."],"exampleFix":"# before\n./install.sh claudeproj\n\n# after\n./install.sh claude-project","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['claude','claude-project','cursor','antigravity','codex','gemini','opencode','codebuddy','joycode','qwen','zed','hermes','openclaw','kimi'];\nfunction isSupportedTarget(t) {\n  return typeof t === 'string' && SUPPORTED.includes(t.trim());\n}\nif (!isSupportedTarget(target)) {\n  throw new Error(`Unsupported target '${target}'. Supported: ${SUPPORTED.join(', ')}`);\n}","typeGuard":"function isInstallTarget(v) {\n  return typeof v === 'string'\n    && ['claude','claude-project','cursor','antigravity','codex','gemini','opencode','codebuddy','joycode','qwen','zed','hermes','openclaw','kimi'].includes(v.trim());\n}","tryCatchPattern":"try {\n  validateLegacyTarget(target);\n} catch (err) {\n  if (/Unknown install target/.test(err.message)) {\n    throw new Error(`${err.message}. Run with --list-targets to see options.`);\n  }\n  throw err;\n}","preventionTips":["Offer a --list-targets flag that prints SUPPORTED_INSTALL_TARGETS.","Trim and case-check the target before validating.","Keep docs and install scripts in sync when targets are added/removed."],"tags":["install","validation","cli"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}