affaan-m/ECC · error · Error

Missing value for --target

Error message

Missing value for --target

What it means

Argument guard in parseArgs: --target was given but the next argv token is missing or starts with '-', so no target value was supplied; parseArgs is a generic CLI parser and the at-fault input is the malformed --target flag.

Solutions

  1. Supply a target immediately after the flag: --target <name>.
  2. If the target legitimately starts with '-', use '--' separation or quote/escape it per the tool docs.
  3. Default target applies if the flag is omitted entirely.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at scripts/consult.js:214 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at scripts/consult.js:214

    target: DEFAULT_TARGET,
    limit: DEFAULT_LIMIT,
    json: false,
    help: false,
  };

  if (args.includes('--help') || args.includes('-h')) {
    parsed.help = true;
    return parsed;
  }

  for (let index = 0; index < args.length; index += 1) {
    const arg = args[index];

    if (arg === '--json') {
      parsed.json = true;
    } else if (arg === '--target') {
      if (!args[index + 1] || args[index + 1].startsWith('-')) {
        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(

View on GitHub (pinned to 8321021c54)