{"record":{"id":"9f1354f9b01a6c97","repo":"affaan-m/ECC","slug":"target-target-is-supported-but-the-bare-lang","errorCode":null,"errorMessage":"Target '${target}' is supported, but the bare-language install syntax only accepts ${LEGACY_INSTALL_TARGETS.join(', ')}. Install '${target}' with a component selection instead, e.g. `install.sh --target ${target} --profile full` (or --modules <id,...> / --skills <id,...>).","messagePattern":"Target '(.+?)' is supported, but the bare-language install syntax only accepts (.+?)\\. Install '(.+?)' with a component selection instead, e\\.g\\. `install\\.sh --target (.+?) --profile full` \\(or --modules <id,\\.\\.\\.> / --skills <id,\\.\\.\\.>\\)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install-executor.js","lineNumber":50,"sourceCode":"    .readdirSync(dirPath, { withFileTypes: true })\n    .filter(entry => entry.isDirectory())\n    .map(entry => entry.name)\n    .sort();\n}\n\nfunction 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\nfunction applyInstallPlan(plan, dependencies = {}) {\n  const { applyInstallPlan: applyPlan } = require('./install/apply');\n  return applyPlan(plan, dependencies);\n}\n\nfunction previewInstallPlan(plan) {\n  const { previewInstallPlan: previewPlan } = require('./install/apply');\n  return previewPlan(plan);\n}\n","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install-executor.js#L32-L68","documentation":"validateLegacyTarget() in scripts/lib/install-executor.js validates the bare positional install.sh target. If the target IS a supported install target but is not one of the legacy bare-language targets (which only accept a handful of languages), it throws this guidance error pointing users at component-selection syntax (--profile/--modules/--skills). It exists to distinguish 'unknown target' from 'supported target, wrong syntax' (issue #2282).","triggerScenarios":"Running `install.sh <target>` where <target> appears in SUPPORTED_INSTALL_TARGETS but not in LEGACY_INSTALL_TARGETS — e.g. a bare-language positional for a language/framework that now requires a component selection.","commonSituations":"Older scripts/docs using the legacy positional syntax after new targets were added; muscle-memory invocations like `./install.sh typescript` when typescript requires `--profile` or `--skills`; CI pipelines with hardcoded legacy install lines.","solutions":["Use the suggested syntax: `install.sh --target <target> --profile full`.","Or select components explicitly: `install.sh --target <target> --modules <id,...>` or `--skills <id,...>`.","Update legacy scripts/docs that pass the bare positional for the new target."],"exampleFix":"// before\n./install.sh typescript\n// after\n./install.sh --target typescript --profile full\n# or\n./install.sh --target typescript --skills typescript-reviewer,typescript-patterns","handlingStrategy":"validation","validationCode":"const { SUPPORTED_INSTALL_TARGETS, LEGACY_INSTALL_TARGETS } = require('./scripts/lib/install-executor');\nfunction validateInvocation(target, hasComponentSelection) {\n  if (!SUPPORTED_INSTALL_TARGETS.includes(target)) return 'unknown';\n  if (!hasComponentSelection && !LEGACY_INSTALL_TARGETS.includes(target)) {\n    return `use --target ${target} --profile full (or --modules/--skills)`;\n  }\n  return 'ok';\n}\nconst verdict = validateInvocation('typescript', process.argv.includes('--profile'));\nif (verdict !== 'ok') { console.error(verdict); process.exit(2); }","typeGuard":"function isLegacyBareTarget(target) { return LEGACY_INSTALL_TARGETS.includes(target); }","tryCatchPattern":"try {\n  createLegacyInstallPlan(target /*, ... */);\n} catch (err) {\n  if (String(err.message).startsWith('Target ') && err.message.includes('bare-language install syntax')) {\n    console.error(`${err.message}`);\n    // retry with component selection\n    createLegacyInstallPlan(null, { target, profile: 'full' });\n  } else throw err;\n}","preventionTips":["Prefer the explicit `--target <t> --profile/--modules/--skills` form for all new scripts.","Treat bare positional targets as legacy-only; reserve them for the legacy language set.","Pin install command lines in CI to the documented modern syntax.","Read the error's suggested command — it is copy-pasteable."],"tags":["cli","installer","deprecated-syntax","argument-validation"],"backgroundTag":"deprecated-api-usage","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}