Support Ukraine πŸ‡ΊπŸ‡¦Help Ukrainian ArmyHumanitarian Assistance to Ukrainians

How to see more details about YN0002 and YN0060 warnings in Yarn?

Laverage

Dec 07 2021 at 21:52 GMT

I added styled-components as dependency to a React project and Yarn printed out the following warnings:

YN0002: app doesn't provide react-is (pc2ee2), requested by styled-components
YN0060: app provides react (p11441) with version 16.7.0, which doesn't satisfy what styled-components requests
YN0060: app provides react-dom (p088fa) with version 16.7.0, which doesn't satisfy what styled-components requests

I understand that the first YN0002 warning says that styled-components requires react-is as peer dependency, however, I would like to know more details, like what's the minimum version required for react-is?

The second and third YN0060 warnings say that I have React 16.7.0, which is not a version that styled-components supports. Here again, I would like to know more details, like what's the minimum version of React that it wants?

So, my question is, how can I see more details about these peer dependency warnings that Yarn outputs?

1 Answer

thoughtful

Dec 07 2021 at 22:06 GMT

When Yarn prints these warnings, it specifies in parentheses a hexadecimal code prefixed by a letter p.

So, for the first YN0002 warning, Yarn specified pc2ee2:

YN0002: app doesn't provide react-is (pc2ee2), requested by styled-components

You can see more details about these warnings by running the following command:

yarn explain peer-requirements <hash>

Where <hash> should be replaced by the p-prefixed hex code. So, in this case, it would be:

yarn explain peer-requirements pc2ee2

This will print out the following:

YN0000: app doesn't provide react-is, breaking the following requirements:

YN0000: styled-components@npm:5.3.3 [0460f] β†’ >= 16.8.0 ✘

So, it says that styled-components requires a version of react-is that is greater than or equal to 16.8.0, but you don't have any installed.

For, the YN0060 warnings, you can do the same. Run:

yarn explain peer-requirements p11441

Which outputs:

YN0000: app provides react@npm:16.7.0 with version 16.7.0, which doesn't satisfy the following requirements:

YN0000: styled-components@npm:5.3.3 [0460f] β†’ >= 16.8.0 ✘

Basically saying that styled-components wants at least React 16.8.0, but you have 16.7.0.

claritician Β© 2022