affaan-m/ECC · error · Error

Legacy language arguments cannot be combined with --profile,

Error message

Legacy language arguments cannot be combined with --profile, --modules, --with, --without, or manifest config selections

What it means

Thrown by normalizeInstallRequest() when the caller mixes legacy positional language arguments (e.g. `install python`) with manifest-mode selectors (--profile, --modules, --with, --without, or equivalent config-file selections). The two install modes are mutually exclusive to prevent ambiguous resolution.

Source

Thrown at scripts/lib/install/request.js:130

    ...(localeComponentId ? [localeComponentId] : []),
  ]);
  const excludeComponentIds = dedupeStrings([
    ...(config?.excludeComponentIds || []),
    ...(options.excludeComponentIds || []),
  ]);
  const legacyLanguages = dedupeStrings(dedupeStrings([
    ...(Array.isArray(options.legacyLanguages) ? options.legacyLanguages : []),
    ...(Array.isArray(options.languages) ? options.languages : []),
  ]).map(language => language.toLowerCase()));
  const hasManifestBaseSelection = Boolean(profileId) || moduleIds.length > 0 || includeComponentIds.length > 0;
  const hasNonLocaleManifestSelection = Boolean(profileId)
    || moduleIds.length > 0
    || requestedIncludeComponentIds.length > 0
    || excludeComponentIds.length > 0;
  const usingManifestMode = hasManifestBaseSelection || excludeComponentIds.length > 0;

  if (hasNonLocaleManifestSelection && legacyLanguages.length > 0) {
    throw new Error(
      'Legacy language arguments cannot be combined with --profile, --modules, --with, --without, or manifest config selections'
    );
  }

  if (!options.help && !hasManifestBaseSelection && legacyLanguages.length === 0) {
    throw new Error('No install profile, module IDs, included components, or legacy languages were provided');
  }

  return {
    mode: legacyLanguages.length > 0
      ? 'legacy-compat'
      : (usingManifestMode ? 'manifest' : 'legacy-compat'),
    target,
    profileId,
    moduleIds,
    includeComponentIds,
    excludeComponentIds,
    legacyLanguages,

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Pick one mode: either use legacy positional languages OR manifest selectors, not both.
  2. Remove the positional language arguments when using --profile/--modules/--with/--without.
  3. Remove the manifest selectors from your config file when using legacy languages.

Example fix

# before
npx ecc install python --profile full
# after (manifest mode)
npx ecc install --profile full
# after (legacy mode)
npx ecc install python
Defensive patterns

Strategy: validation

Validate before calling

function isManifestSelection(options) {
  return Boolean(options?.profileId)
    || (options?.moduleIds?.length ?? 0) > 0
    || (options?.includeComponentIds?.length ?? 0) > 0
    || (options?.excludeComponentIds?.length ?? 0) > 0;
}
function isLegacy(options) {
  return (options?.legacyLanguages?.length ?? 0) > 0 || (options?.languages?.length ?? 0) > 0;
}
if (isManifestSelection(options) && isLegacy(options)) {
  throw new Error('Choose either legacy languages OR manifest selectors, not both.');
}

Type guard

function isLegacyMode(options) {
  return (options?.languages?.length ?? 0) > 0 || (options?.legacyLanguages?.length ?? 0) > 0;
}

Try / catch

try {
  request = normalizeInstallRequest(options);
} catch (e) {
  if (/Legacy language arguments cannot be combined/.test(e.message)) {
    const { languages, legacyLanguages, ...manifest } = options;
    request = normalizeInstallRequest(manifest);
  } else throw e;
}

Prevention

When it happens

Trigger: Running `npx ecc install python --profile full`, or having legacyLanguages in the config while also passing --modules, --with, or --without on the CLI.

Common situations: Migrating from the old language-based CLI to the new manifest/profile CLI and forgetting to remove the positional language; sharing a config file between team members who use different CLI styles.

Related errors


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