npm "peer dep missing" Warning in CI - Resolve Unmet Peer Dependencies
A "peer dep missing" warning means a package expects another package to be present in your tree, but it is not installed. Older npm warns; the missing peer can still break the build.
What this error means
During install npm prints a requires a peer of ... but none is installed line. A later build or test step then fails with a module-not-found or runtime error from the package whose peer was never satisfied.
npm
npm WARN @acme/charts@2.0.0 requires a peer of d3@^7.0.0
npm WARN but none is installed. You must install peer dependencies yourself.Common causes
A declared peer dependency was never added to package.json
The package assumes you provide the peer (a framework or plotting library), but it was never listed as a direct dependency.
The installed peer is outside the required range
A peer is present but at an incompatible major, so the requirement is still unmet.
How to fix it
Install the missing peer at a compatible version
- Read the warning to find the required peer name and range.
- Add it as a direct dependency at a version inside that range.
- Reinstall and commit the updated lockfile.
Terminal
npm install d3@^7How to prevent it
- Treat peer warnings as build-blockers in CI, audit them with npm ls, and add each required peer explicitly so a fresh clone installs a complete, working tree.
Related guides
npm ERESOLVE "unable to resolve dependency tree" in CI - Fix It ProperlyFix the npm ERESOLVE "unable to resolve dependency tree" error in CI by resolving the real peer version confl…
npm EBADENGINE "Unsupported engine" in CI - Fix Node Version MismatchFix "npm WARN EBADENGINE unsupported engine" in CI by matching the runner Node version to the engines field y…
pnpm ERR_PNPM_PEER_DEP_ISSUES in CI - Fix Strict Peer Dependency FailuresFix ERR_PNPM_PEER_DEP_ISSUES in CI by satisfying unmet peer dependencies, since pnpm with strict-peer-depende…