npm registry (npm.pkg.github.com) omits peerDependenciesMeta from package metadata, so optional peers become required #213890
Replies: 2 comments
|
Thank you for your interest in contributing to our community! We currently only accept discussions created through the GitHub UI using our provided discussion templates. Please re-submit your discussion by navigating to the appropriate category and using the template provided. This discussion has been closed because it was not submitted through the expected format. If you believe this was a mistake, please reach out to the maintainers. |
|
This is a known structural limitation in GitHub Packages' npm registry implementation ( Why This Happens:
Working Solutions for Consumers:Until GitHub Packages updates its packument serialization pipeline to include For
|
Uh oh!
There was an error while loading. Please reload this page.
Summary: the npm registry at
npm.pkg.github.comleavespeerDependenciesMetaout of the package metadata (packument) it serves, although the published tarball'spackage.jsonhas it. Clients that resolve peers from the packument, such as pnpm and npm, then treat every optional peer as required.Steps to reproduce
package.jsonhas:npm view @scope/pkg@<version> --json, and seepeerDependenciesbut nopeerDependenciesMeta.npm pack @scope/pkg@<version>and readpackage/package.json, and seepeerDependenciesMetapresent.pnpm peers checkreportsunmet peer eslint, and the lockfile entry has nopeerDependenciesMeta.Expected: the packument's version object carries
peerDependenciesMeta, as registry.npmjs.org does, so optional peers stay optional.Impact: every package on GitHub Packages that declares an optional peer reports it as required to every consumer. The only workaround is per-consumer config (
pnpm.peerDependencyRules.ignoreMissing).All reactions