angular/angular-cli · warning

PackageGroup metadata for ${metadata.name} is malformed. Ign

Error message

PackageGroup metadata for ${metadata.name} is malformed. Ignoring.

What it means

A second, stricter path in update-resolver normalizes a package's PackageGroup metadata and, if it cannot be normalized into a Record<string, string>, warns that the metadata is malformed and returns early (no package group applied). Unlike error 396 this path aborts the group handling entirely for that metadata set.

Source

Thrown at packages/angular/cli/src/commands/update/update-resolver.ts:697

        acc[curr] = version;

        return acc;
      },
      {} as Record<string, string>,
    );
  } else if (typeof packageGroup === 'object' && packageGroup !== null) {
    packageGroupNormalized = Object.entries(packageGroup).reduce(
      (acc, [name, v]) => {
        if (typeof v === 'string') {
          acc[name] = v;
        }

        return acc;
      },
      {} as Record<string, string>,
    );
  } else {
    logger.warn(`PackageGroup metadata for ${metadata.name} is malformed. Ignoring.`);

    return;
  }

  for (const [member, memberVersion] of Object.entries(packageGroupNormalized)) {
    if (packages.has(member)) {
      continue;
    }
    if (allDependencies.has(member)) {
      packages.set(member, memberVersion as VersionRange);
    }
  }
}

async function _addPeerDependencies(
  packages: Map<string, VersionRange>,
  allDependencies: ReadonlyMap<string, VersionRange>,
  npmPackageJson: PackageMetadata,

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Locate the package named in the warning and inspect its 'ng-update' metadata; update to a fixed version if the publisher corrected it.
  2. Continue the update if acceptable — the group is skipped and other packages update normally, but be prepared to update grouped packages manually.
  3. Manually update related group members (e.g., @angular/material with @angular/cdk) to matching versions.
  4. If it's your library, publish corrected packageGroup metadata (flat name→version object).

Example fix

// before: invalid group values
"packageGroup": { "@angular/cdk": 12 }
// after
"packageGroup": { "@angular/cdk": "0.0.0-PLACEHOLDER" }
Defensive patterns

Strategy: type-guard

Validate before calling

const groupRaw = metadata.packageGroup;
if (!isPlainStringRecord(groupRaw)) {
  console.warn('packageGroup malformed; grouped packages must be updated manually');
}

Type guard

function isPlainStringRecord(v: unknown): v is Record<string, string> {
  return typeof v === 'object' && v !== null && !Array.isArray(v)
    && Object.values(v).every(x => typeof x === 'string');
}

Try / catch

try {
  const group = normalizePackageGroup(metadata);
} catch {
  logger.warn('PackageGroup metadata malformed; skipping group');
  return null;
}

Prevention

When it happens

Trigger: During update peer/group resolution, the PackageGroup entries of a package's ng-update metadata fail normalization (non-object shape or invalid member/version values), triggering the else branch that warns and returns.

Common situations: Third-party Angular ecosystem packages with hand-written, incorrectly typed packageGroup fields; mismatched versions between library majors; testing local/linked packages with stub metadata.

Understand the failure class

Related errors


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/a709ea24842fe642. Report an issue: GitHub.