affaan-m/ECC · error · Error

Unknown install target

Error message

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

What it means

parseArgs in scripts/consult.js validates the --install-target CLI flag against SUPPORTED_INSTALL_TARGETS before running a consult lookup. If the user names a target (install surface) that the consult tool does not know, it refuses with a list of valid targets. This keeps installs from being routed to nonexistent or unsupported surfaces.

Solutions

  1. Read the expected list from the error message and pass one of the listed targets.
  2. Check SUPPORTED_INSTALL_TARGETS at the top of scripts/consult.js for the current valid values.
  3. If the target should exist, update SUPPORTED_INSTALL_TARGETS (and related routing) in scripts/consult.js.

Example fix

// before
node scripts/consult.js --install-target hooks "security review"
// after
node scripts/consult.js --install-target skills "security review"
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = ['skills', 'commands']; // mirror from scripts/consult.js
if (!SUPPORTED.includes(target)) {
  throw new Error(`Unsupported target: ${target}. Expected one of ${SUPPORTED.join(', ')}`);
}

Type guard

function isValidTarget(t) { return typeof t === 'string' && SUPPORTED_INSTALL_TARGETS.includes(t); }

Try / catch

try {
  runConsult(['--install-target', target, query]);
} catch (e) {
  if (e.message.startsWith('Unknown install target')) {
    console.error(`Pick a target from: ${e.message.match(/Expected one of (.*)/)?.[1]}`);
  } else throw e;
}

Prevention

When it happens

Trigger: Running the consult script with `--install-target <value>` where <value> is not in SUPPORTED_INSTALL_TARGETS — e.g. a typo, a renamed surface, or a target from a newer/older version of the repo.

Common situations: Typing `--install-target agents` when only e.g. `skills,commands` are supported; following outdated docs; scripting the CLI with a hardcoded target after the target list changed.

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/8246f55181716461. Report an issue: GitHub.

Appendix: source

Thrown at scripts/consult.js:232

        throw new Error('Missing value for --target');
      }
      parsed.target = args[index + 1];
      index += 1;
    } else if (arg === '--limit') {
      if (!args[index + 1]) {
        throw new Error('Missing value for --limit');
      }
      parsed.limit = Math.min(parsePositiveInteger(args[index + 1], '--limit'), MAX_LIMIT);
      index += 1;
    } else if (arg.startsWith('-')) {
      throw new Error(`Unknown argument: ${arg}`);
    } else {
      parsed.queryParts.push(arg);
    }
  }

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

  parsed.query = parsed.queryParts.join(' ').trim();
  return parsed;
}

function commandFor(kind, id, target) {
  if (kind === 'profile') {
    return `npx ecc-universal install --profile ${id} --target ${target}`;
  }

  return `npx ecc-universal install --profile minimal --target ${target} --with ${id}`;
}

function planCommandFor(componentId, target) {
  return `npx ecc-universal plan --profile minimal --target ${target} --with ${componentId}`;

View on GitHub (pinned to 8321021c54)