ピア依存関係 - CI/CD 用語集の定義
peer dependency とは、あなたのライブラリが自身に同梱するのではなく、ホストプロジェクトが提供することを期待するパッケージで、複数の plugin が一つのコピーを共有できるよう peerDependencies の下に宣言されます。
典型的な例
React コンポーネントライブラリは react を peer dependency として列挙します。動作には React が必要ですが、自身のコピーを同梱してはなりません。さもないとアプリが 2 つの React を読み込み、hooks が壊れてしまいます。
CI での失敗
不一致は npm ERR! ERESOLVE unable to resolve dependency tree として現れます。npm v7 以降は peer を厳格に強制します。--legacy-peer-deps は以前の緩い挙動を復元します。
関連ガイド
Transitive Dependency - CI/CD Glossary DefinitionTransitive Dependency: A transitive dependency is a package you do not require directly but that one of your…
Scoped Package - CI/CD Glossary DefinitionScoped Package: A scoped package is an npm package namespaced under an `@scope/` prefix, like `@latchkey/cli`…
Dependency Graph - CI/CD Glossary DefinitionDependency Graph: A dependency graph is the directed graph of which packages depend on which others, used by…