2

I just started using Yarn workspaces and have two packages defined, let's call them Alpha and Beta. Beta depends on Alpha.

Alpha has a peer dependency for somelib@^1.2.3, so I added somelib@^1.2.3 as dependency to Beta's package.json.

When installing, I get the warning

> alpha@0.1.0" has unmet peer dependency "somelib@^1.2.3".

I would assume by adding somelib@^1.2.3 as dependency to Beta, the peer dependency is satisfied. Why do I still get a warning, how do I satisfy the peer dependency?

Sven
  • 12,997
  • 27
  • 90
  • 148
  • Take a look on this https://github.com/yarnpkg/yarn/issues/5347 – Skizo-ozᴉʞS ツ Jan 02 '23 at 12:47
  • @Skizo-ozᴉʞS Are you implying this is a bug in Yarn? From the issue I get the feeling it's more of a user error. – Sven Jan 02 '23 at 13:39
  • I just ran into the same issue and noticed that the warnings go away when adding the peer dependencies to the root package.json (even though that's not where they belong). So I'm assuming it's a bug in Yarn. – Taig Mar 03 '23 at 13:24

0 Answers0