affaan-m/ECC · error · Error

Target '${target}' is supported, but the bare-language insta

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

Thrown by validateLegacyTarget() in scripts/lib/install-executor.js when the requested target IS in SUPPORTED_INSTALL_TARGETS but is NOT in the small LEGACY_INSTALL_TARGETS set (claude, claude-project, cursor, antigravity). The bare-language positional install syntax only accepts the legacy set; newer targets require an explicit --target plus component selection.

Source

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

    .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(', ')}`);
}

const IGNORED_DIRECTORY_NAMES = new Set(['node_modules', '.git']);

function listFilesRecursive(dirPath) {
  if (!fs.existsSync(dirPath)) {
    return [];
  }

  const files = [];
  const entries = fs.readdirSync(dirPath, { withFileTypes: true });

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Switch to the explicit target + component syntax: install.sh --target <id> --profile full.
  2. Or select modules/skills explicitly: install.sh --target <id> --modules <id,...> or --skills <id,...>.
  3. If you actually want one of the legacy targets (claude, claude-project, cursor, antigravity), pass it as-is via the positional form.

Example fix

# before
./install.sh codex

# after
./install.sh --target codex --profile full
# or
./install.sh --target codex --skills python-patterns
Defensive patterns

Strategy: validation

Validate before calling

const { LEGACY_INSTALL_TARGETS, SUPPORTED_INSTALL_TARGETS } = {
  LEGACY_INSTALL_TARGETS: ['claude', 'claude-project', 'cursor', 'antigravity'],
  SUPPORTED_INSTALL_TARGETS: ['claude','claude-project','cursor','antigravity','codex','gemini','opencode','codebuddy','joycode','qwen','zed','hermes','openclaw','kimi'],
};
function isLegacyBareTarget(t) { return LEGACY_INSTALL_TARGETS.includes(t); }
function needsExplicitTargetSyntax(t) {
  return SUPPORTED_INSTALL_TARGETS.includes(t) && !LEGACY_INSTALL_TARGETS.includes(t);
}

Try / catch

try {
  validateLegacyTarget(target);
} catch (err) {
  if (/bare-language install syntax/.test(err.message)) {
    // re-dispatch through the explicit target path
    return runInstall({ target, profile: 'full' });
  }
  throw err;
}

Prevention

When it happens

Trigger: validateLegacyTarget('codex'), validateLegacyTarget('gemini'), validateLegacyTarget('opencode'), etc. — i.e. user invokes the legacy positional install path: install.sh codex (instead of install.sh --target codex).

Common situations: User follows an old blog post showing ./install.sh <language>; user types a bare target name expecting it to work for all harnesses; CI script invokes the legacy positional form for a newer harness.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/9f1354f9b01a6c97. Report an issue: GitHub.