affaan-m/ECC · error

Unknown install target

Error message

Unknown install target: ${target}. Expected one of ${SUPPORTED_INSTALL_TARGETS.join(', ')}

What it means

listInstallComponents() validates the optional options.target against SUPPORTED_INSTALL_TARGETS before filtering. If the target string is not in that list, the library throws instead of returning an empty result set, to surface misconfiguration early.

Solutions

  1. Use one of the targets listed in the error message / SUPPORTED_INSTALL_TARGETS exactly
  2. Fix casing/typo in the target value
  3. Omit the target option to list components across all targets, then inspect valid targets from the manifests
  4. Validate user-supplied targets against SUPPORTED_INSTALL_TARGETS before calling

Example fix

// before
listInstallComponents({ target: 'vscode' });
// after
listInstallComponents({ target: 'claude' });
Defensive patterns

Strategy: validation

Validate before calling

const { SUPPORTED_INSTALL_TARGETS } = require('./scripts/lib/install-manifests');
if (target != null && !SUPPORTED_INSTALL_TARGETS.includes(target)) {
  throw new Error(`Invalid install target '${target}'. Valid: ${SUPPORTED_INSTALL_TARGETS.join(', ')}`);
}

Type guard

const isValidTarget = (t) => typeof t === 'string' && SUPPORTED_INSTALL_TARGETS.includes(t);

Try / catch

try {
  const comps = listInstallComponents({ target });
} catch (err) {
  if (err.message.startsWith('Unknown install target')) {
    console.error(err.message);
    process.exitCode = 1;
  } else throw err;
}

Prevention

When it happens

Trigger: Calling listInstallComponents({ target: 'cursor' }) (or any target not in SUPPORTED_INSTALL_TARGETS) — e.g. a misspelled target, a target from another tool, or one removed in a newer version.

Common situations: Passing a harness name the plugin does not install to, copying target values from another tool's config, or stale docs listing a removed install target.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at scripts/lib/install-manifests.js:393

  const manifests = loadInstallManifests(options);
  const normalizedModuleIds = dedupeStrings(moduleIds);
  assertKnownModuleIds(normalizedModuleIds, manifests);
  return normalizedModuleIds;
}

function listInstallComponents(options = {}) {
  const manifests = loadInstallManifests(options);
  const family = options.family || null;
  const target = options.target || null;

  if (family && !Object.hasOwn(COMPONENT_FAMILY_PREFIXES, family)) {
    throw new Error(
      `Unknown component family: ${family}. Expected one of ${Object.keys(COMPONENT_FAMILY_PREFIXES).join(', ')}`
    );
  }

  if (target && !SUPPORTED_INSTALL_TARGETS.includes(target)) {
    throw new Error(
      `Unknown install target: ${target}. Expected one of ${SUPPORTED_INSTALL_TARGETS.join(', ')}`
    );
  }

  return manifests.components
    .filter(component => !family || component.family === family)
    .map(component => {
      const moduleIds = dedupeStrings(component.modules);
      const modules = moduleIds
        .map(moduleId => manifests.modulesById.get(moduleId))
        .filter(Boolean);
      const targets = intersectTargets(modules);

      return {
        id: component.id,
        family: component.family,
        description: component.description,
        moduleIds,

View on GitHub (pinned to 8321021c54)