yarnpkg/yarn · error · MessageError

manifestStringExpected

Error message

manifestStringExpected

What it means

Error "manifestStringExpected" thrown in yarnpkg/yarn.

Source

Thrown at src/util/normalize-manifest/validate.js:93

  }

  // validate license
  if (isRoot && !info.private) {
    if (typeof info.license === 'string') {
      const license = info.license.replace(/\*$/g, '');
      if (!isValidLicense(license)) {
        warn(reporter.lang('manifestLicenseInvalid'));
      }
    } else {
      warn(reporter.lang('manifestLicenseNone'));
    }
  }

  // validate strings
  for (const key of strings) {
    const val = info[key];
    if (val && typeof val !== 'string') {
      throw new MessageError(reporter.lang('manifestStringExpected', key));
    }
  }

  cleanDependencies(info, isRoot, reporter, warn);
}

export function cleanDependencies(info: Object, isRoot: boolean, reporter: Reporter, warn: WarnFunction) {
  // get dependency objects
  const depTypes = [];
  for (const type of dependencyKeys) {
    const deps = info[type];
    if (!deps || typeof deps !== 'object') {
      continue;
    }
    depTypes.push([type, deps]);
  }

  // aggregate all non-trivial deps (not '' or '*')

View on GitHub (pinned to c2dda503f3)

Solutions

  1. The manifest field named in the error must be a string but holds another type (object, array, number, or boolean). Change its value in package.json to a plain string.

Example fix

"description": {"text": "..."} -> "description": "..."

When it happens

Trigger: A manifest field expected to be a string is not a string during normalization validation in src/util/normalize-manifest/validate.js.

Common situations: Occurs when package.json fields like 'name', 'version', 'license', or 'bin' entries contain arrays, objects, or numbers instead of strings.


AI-assisted analysis of yarnpkg/yarn@c2dda503f3 (2026-08-13). Data as JSON: /api/errors/cc356a2a18a73998. Report an issue: GitHub.