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
react-is as peer dependency, however, I would like to know more details, like what's the minimum version required for
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?
When Yarn prints these warnings, it specifies in parentheses a hexadecimal code prefixed by a letter
So, for the first
YN0002 warning, Yarn specified
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>
<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.
YN0060 warnings, you can do the same. Run:
yarn explain peer-requirements p11441
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.