{"record":{"id":"a9e62bb90099fda8","repo":"angular/angular-cli","slug":"packagegroup-metadata-for-packagejson-name-is-m","errorCode":null,"errorMessage":"PackageGroup metadata for ${packageJson.name} is malformed. Ignoring.","messagePattern":"PackageGroup metadata for (.+?) is malformed\\. Ignoring\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/angular/cli/src/commands/update/update-resolver.ts","lineNumber":356,"sourceCode":"          group[name] = packageJson.version;\n\n          return group;\n        },\n        {} as { [key: string]: string },\n      );\n    } else if (typeof packageGroup == 'object' && packageGroup !== null) {\n      result.packageGroup = Object.entries(packageGroup).reduce(\n        (group, [name, version]) => {\n          if (typeof version == 'string') {\n            group[name] = version;\n          }\n\n          return group;\n        },\n        {} as { [key: string]: string },\n      );\n    } else {\n      logger.warn(`PackageGroup metadata for ${packageJson.name} is malformed. Ignoring.`);\n    }\n  }\n\n  if (typeof metadata['packageGroupName'] == 'string') {\n    result.packageGroupName = metadata['packageGroupName'];\n  }\n\n  if (typeof metadata['migrations'] == 'string') {\n    result.migrations = metadata['migrations'];\n  }\n\n  return result;\n}\n\nexport function isPnpActive(workspaceRoot: string): boolean {\n  return (\n    process.versions.pnp !== undefined ||\n    existsSync(path.join(workspaceRoot, '.pnp.cjs')) ||","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/update/update-resolver.ts#L338-L374","documentation":"During update resolution, the CLI reads a package's 'ng-update' PackageGroup metadata (which maps sibling packages to versions that must migrate together). If that metadata exists but is structurally malformed (not a plain object of member→version), it is logged as malformed, ignored, and resolution proceeds without the group constraints.","triggerScenarios":"_getUpdateMetadata parses the 'packageGroup'/'packageGroupRange' style metadata of a package being updated (e.g., @angular/core) and the normalized result is not a valid Record<string, string>, taking the else branch that warns.","commonSituations":"A library published a broken ng-update packageGroup (wrong types, nested objects, arrays); using canary/next builds of Angular packages where metadata is temporarily inconsistent; a registry mirror serving altered package.json.","solutions":["Identify the offending package (named in the warning) and check its package.json 'ng-update' field; report/fix it upstream if it's a third-party lib.","Pin to a stable published version of the package whose metadata is valid instead of next/canary.","Proceed without action if the group is unimportant: the CLI ignores it and continues the update.","If it's your own library, correct the packageGroup to a flat object of package name → version range and republish."],"exampleFix":"// before: malformed ng-update metadata\n\"ng-update\": { \"packageGroup\": [\"@angular/cdk\"] }\n// after: valid group map\n\"ng-update\": { \"packageGroup\": { \"@angular/cdk\": \"0.0.0-PLACEHOLDER\" } }","handlingStrategy":"fallback","validationCode":"const ngUpdate = pkg['ng-update'] ?? {};\nconst group = ngUpdate.packageGroup;\nconst valid = group && typeof group === 'object' && !Array.isArray(group)\n  && Object.values(group).every(v => typeof v === 'string');\nif (!valid) console.warn(`${pkg.name} packageGroup malformed; group constraints will be ignored`);","typeGuard":"function isPackageGroup(v: unknown): v is Record<string, string> {\n  return !!v && typeof v === 'object' && !Array.isArray(v)\n    && Object.entries(v).every(([k, val]) => typeof k === 'string' && typeof val === 'string');\n}","tryCatchPattern":"try {\n  applyPackageGroup(metadata);\n} catch {\n  logger.warn('PackageGroup malformed; updating without group constraints');\n}","preventionTips":["Prefer stable releases over canary/next for update runs.","When authoring libraries, publish packageGroup as a flat name→version object.","Check package.json 'ng-update' of the named package when this warning appears.","Manually update grouped siblings (e.g., material/cdk) after a skipped group."],"tags":["update","metadata","angular-cli","package-resolution"],"backgroundTag":"malformed-package-group-metadata","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}