affaan-m/ECC · error

Target ' ' is supported, but the bare-language install…

Error message

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,...>).

What it means

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).

Solutions

  1. Use the suggested syntax: `install.sh --target <target> --profile full`.
  2. Or select components explicitly: `install.sh --target <target> --modules <id,...>` or `--skills <id,...>`.
  3. Update legacy scripts/docs that pass the bare positional for the new target.

Example fix

// before
./install.sh typescript
// after
./install.sh --target typescript --profile full
# or
./install.sh --target typescript --skills typescript-reviewer,typescript-patterns
Defensive patterns

Strategy: validation

Validate before calling

const { SUPPORTED_INSTALL_TARGETS, LEGACY_INSTALL_TARGETS } = require('./scripts/lib/install-executor');
function validateInvocation(target, hasComponentSelection) {
  if (!SUPPORTED_INSTALL_TARGETS.includes(target)) return 'unknown';
  if (!hasComponentSelection && !LEGACY_INSTALL_TARGETS.includes(target)) {
    return `use --target ${target} --profile full (or --modules/--skills)`;
  }
  return 'ok';
}
const verdict = validateInvocation('typescript', process.argv.includes('--profile'));
if (verdict !== 'ok') { console.error(verdict); process.exit(2); }

Type guard

function isLegacyBareTarget(target) { return LEGACY_INSTALL_TARGETS.includes(target); }

Try / catch

try {
  createLegacyInstallPlan(target /*, ... */);
} catch (err) {
  if (String(err.message).startsWith('Target ') && err.message.includes('bare-language install syntax')) {
    console.error(`${err.message}`);
    // retry with component selection
    createLegacyInstallPlan(null, { target, profile: 'full' });
  } else throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/9f1354f9b01a6c97. Report an issue: GitHub.

Appendix: source

Thrown at scripts/lib/install-executor.js:50

    .readdirSync(dirPath, { withFileTypes: true })
    .filter(entry => entry.isDirectory())
    .map(entry => entry.name)
    .sort();
}

function listAvailableLanguages(sourceRoot = getSourceRoot()) {
  return [...new Set([...listLegacyCompatibilityLanguages(), ...readDirectoryNames(path.join(sourceRoot, 'rules')).filter(name => name !== 'common')])].sort();
}

function validateLegacyTarget(target) {
  if (LEGACY_INSTALL_TARGETS.includes(target)) {
    return;
  }
  // A target can be fully supported yet not installable via the bare-language
  // positional syntax (which is legacy-only). Guide the user to the right mode
  // instead of implying the target is unknown (#2282).
  if (SUPPORTED_INSTALL_TARGETS.includes(target)) {
    throw new Error(
      `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,...>).`
    );
  }
  throw new Error(`Unknown install target: ${target}. Expected one of ${SUPPORTED_INSTALL_TARGETS.join(', ')}`);
}

function applyInstallPlan(plan, dependencies = {}) {
  const { applyInstallPlan: applyPlan } = require('./install/apply');
  return applyPlan(plan, dependencies);
}

function previewInstallPlan(plan) {
  const { previewInstallPlan: previewPlan } = require('./install/apply');
  return previewPlan(plan);
}

View on GitHub (pinned to 8321021c54)