Skip to content
Latchkey

Peer Dependency - CI/CD Glossary Definition

A peer dependency is a package your library expects the host project to provide rather than bundling itself, declared under peerDependencies so multiple plugins share one copy.

Classic example

A React component library lists react as a peer dependency. It needs React to run but must not ship its own copy, or the app would load two Reacts and hooks would break.

The CI failure

A mismatch surfaces as npm ERR! ERESOLVE unable to resolve dependency tree. npm v7+ enforces peers strictly; --legacy-peer-deps restores the older, looser behavior.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →