Ask questionsFresh new install gives unmet peer dependencies warnings with yarn
Intended outcome:
I tried to start a new Apollo project, based on the documentation I issued:
yarn add react react-dom apollo-boost @apollo/react-hooks graphql
Which gave:
warning "@apollo/react-hooks > @apollo/[email protected]" has unmet peer dependency "@types/react@^16.8.0".
warning "@apollo/react-hooks > @apollo/[email protected]" has unmet peer dependency "apollo-client@^2.6.4".
warning "@apollo/react-hooks > @apollo/[email protected]" has unmet peer dependency "apollo-utilities@^1.3.2".
warning " > @apollo/[email protected]" has unmet peer dependency "@types/react@^16.8.0".
warning " > @apollo/[email protected]" has unmet peer dependency "apollo-client@^2.6.4".
Actual outcome:
I would expect either no warnings or those peer deps being mentioned in the documentation
Note that with npm instead of yarn, I only get those warnings:
npm WARN @apollo/[email protected] requires a peer of @types/react@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN @apollo/[email protected] requires a peer of @types/react@^16.8.0 but none is installed. You must install peer dependencies yourself.
How to reproduce the issue:
yarn init
yarn add react react-dom apollo-boost @apollo/react-hooks graphql
Version
System:
OS: macOS 10.14.5
Binaries:
Node: 10.14.2 - ~/.nvm/versions/node/v10.14.2/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.14.2/bin/npm
Browsers:
Chrome: 76.0.3809.100
Firefox: 68.0.2
Safari: 12.1.1
npmPackages:
apollo-boost: ^0.4.4 => 0.4.4
Answer
questions
Tylerian
Thing is yarn complains even when the required peer dependencies are already installed if the version is mismatching.
for example in my project I'm using react@latest(16.10.2) and the following shows in yarn:
warning " > @apollo/[email protected]" has unmet peer dependency "react@^16.8.0".
Is this desired behavior?
Related questions