mochajs/mocha · error · Error

ERR_MOCHA_UNSUPPORTED

ERR_MOCHA_UNSUPPORTED

Error message

Option ${numericArg} is unsupported by the mocha cli

What it means

Error "Option ${numericArg} is unsupported by the mocha cli" thrown in mochajs/mocha.

Source

Thrown at lib/cli/parse-args.js:371

  //    option has an incompatible datatype.
  const flag = allArgs.find((arg, index) => {
    const normalizedArg = stripLeadingDashes(arg);
    return (
      isMochaFlag(arg) &&
      allArgs[index + 1] === String(numericArg) &&
      parsedResult[normalizedArg] !== String(numericArg)
    );
  });

  if (flag) {
    throw createInvalidArgumentTypeError(
      `Mocha flag '${flag}' given invalid option: '${numericArg}'`,
      numericArg,
      expectedTypeForFlag(flag),
    );
  }

  throw createUnsupportedError(
    `Option ${numericArg} is unsupported by the mocha cli`,
  );
};

/**
 * Parse the args into a config object.
 * Splits,
 * handles Node args,
 * validates general args,
 * parses into config object,
 * normalizes,
 * validates numerical args,
 * and returns resulting config object.
 * @param {string|string[]} args
 * @param {object} defaultValues
 * @param  {...any} configObjects
 */
export const parseMochaArgs = (

View on GitHub (pinned to 6bcbee4fd9)

When it happens

Trigger: Thrown at lib/cli/parse-args.js:371 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mochajs/mocha@6bcbee4fd9 (2026-09-01). Data as JSON: /api/errors/38882951824e2991. Report an issue: GitHub.