-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
We have various peer dependency warnings displayed when running yarn install
inside our own repository. It would be great if we could fix the upstream packages to stop it from happening, as it's a matter of time before it causes more serious issues:
Given a warning:
X doesn't provide Y requested by Z
The best fix is generally to either:
-
Upgrade the faulty package in our codebase to get rid of the warning. Some of those may have already been fixed.
- For example, upgrading Gatsby might fix the
2.0.0-printer-fix.2
error.
- For example, upgrading Gatsby might fix the
-
Mark Y as an optional peer dependency in Z, if Z doesn't need Y to work. If Z's maintainers are concerned about potential warnings being shown to their users, tell them that optional peer dependencies are supported by Yarn, npm 6.1+, and pnpm. It's a feature they should use.
-
Add Y as a peer dependency of X. This will move the warning up by one level, but by doing this it's possible that the peer dependency will be met in a satisfying way. For example, if
react-bar
as a peer depencency onreact
and is a dependency ofreact-foo
, then you can addreact
to the peer dependencies ofreact-foo
. Then it'll be up to whoever depends onreact-foo
to depends onreact
as well.- For example, I strongly suspect it's the case of
jest-jasmine2
which should have a peer dependency onjest-haste-map
.
- For example, I strongly suspect it's the case of
-
Add Y as regular dependency of X if it's just a matter of a peer dependency having been omitted by mistake.
- For example,
html-react-parser
should probably have regular dependencies on bothobject-assign
andfbjs
to satisfy the requirements ofreact-dom-core
.
- For example,