affaan-m/ECC · error · Error
Missing value for --locale
Error message
Missing value for --locale
What it means
Thrown by the install CLI argument parser when --locale is the last token on the command line or is immediately followed by another flag (a token starting with --). The parser expects --locale to consume the next argv slot as the locale value.
Source
Thrown at scripts/lib/install/request.js:67
} else if (arg === '--with') {
const componentId = args[index + 1] || '';
if (componentId.trim()) {
parsed.includeComponentIds.push(componentId.trim());
}
index += 1;
} else if (arg === '--skill' || arg === '--skills') {
parsed.includeComponentIds.push(...normalizeSkillComponentIds(args[index + 1] || ''));
index += 1;
} else if (arg === '--without') {
const componentId = args[index + 1] || '';
if (componentId.trim()) {
parsed.excludeComponentIds.push(componentId.trim());
}
index += 1;
} else if (arg === '--locale') {
const locale = args[index + 1] || '';
if (!locale || locale.startsWith('--')) {
throw new Error('Missing value for --locale');
}
parsed.locale = locale;
index += 1;
} else if (arg === '--dry-run') {
parsed.dryRun = true;
} else if (arg === '--json') {
parsed.json = true;
} else if (arg === '--help' || arg === '-h') {
parsed.help = true;
} else if (arg.startsWith('--')) {
throw new Error(`Unknown argument: ${arg}`);
} else {
parsed.languages.push(arg);
}
}
return parsed;
}View on GitHub (pinned to 01e15490f0)
Solutions
- Supply a supported locale value immediately after --locale, e.g. `--locale zh-CN`.
- If locale was unintended, remove the --locale flag entirely.
- Quote the value if it contains special characters (none of the supported locales do, so this usually indicates a different bug).
Example fix
# before npx ecc install --locale # after npx ecc install --locale zh-CN --target claude
Defensive patterns
Strategy: validation
Validate before calling
function hasLocaleValue(argv) {
const i = argv.indexOf('--locale');
if (i === -1) return true;
const next = argv[i + 1];
return Boolean(next) && !next.startsWith('--');
} Try / catch
try {
const request = normalizeInstallRequest(parseInstallArgs(argv));
} catch (e) {
if (/Missing value for --locale/.test(e.message)) {
console.error('Usage: ecc install --locale <locale> ...');
process.exit(2);
}
throw e;
} Prevention
- Validate flag/value pairs before invoking the parser when building commands programmatically.
- Prefer config-file locale over the CLI flag to avoid shell-quoting pitfalls.
- Print --help output when the parser rejects arguments so users can self-correct.
When it happens
Trigger: Invoking `npx ecc install --locale` with no following argument, or `--locale --target claude` where the next token is itself a flag.
Common situations: Typos; copy-pasting a partial command; shell-quoting bugs that drop the locale value; scripts that conditionally append --locale but forget the value.
Related errors
- Unknown argument: ${arg}
- Unsupported locale: "${locale}". Supported locales: ${listSu
- --locale can only be used with --target claude or --target c
- Legacy language arguments cannot be combined with --profile,
- No install profile, module IDs, included components, or lega
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/373e73801b6ccf70.
Report an issue: GitHub.