how to resolve 'yarn package has unmet peer dependency'

deltaskelta picture deltaskelta · Dec 27, 2018 · Viewed 7.4k times · Source

I get a load of warnings when I run yarn upgrade or install because of unmet peerDependencies.

warning " > [email protected]" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0".
warning " > [email protected]" has unmet peer dependency "@babel/core@^7.0.0".

As I understand it, the listed packages need the dependency, and another package in my project has the dependency, I can find the deps but I can't find any information about how to direct the said packages to the sub dependency that I know exists.

How can I get yarn to quiet down and show it where these deps are?

Answer

Andrea Carraro picture Andrea Carraro · Jan 9, 2019

Both warnings are about peer dependencies, which means that it's your application's responsability to provide those packages as dependencies.

In this case graphql and @babel/core are expected to be installed in your root app.