Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Fix yarn "unmet peer dependency" warnings #751

Closed
edmorley opened this issue Mar 16, 2018 · 1 comment
Closed

Fix yarn "unmet peer dependency" warnings #751

edmorley opened this issue Mar 16, 2018 · 1 comment
Assignees

Comments

@edmorley
Copy link
Member

edmorley commented Mar 16, 2018

yarn is more fussy about peer dependencies than npm, in that it doesn't take into account that dependencies are being hoisted, so warns if a peerDependency is not explicitly specified at the top level (see yarnpkg/yarn#4675).

Some of the Neutrino packages trigger this case, so result in noisy yarn warnings that don't mean anything is broken, but that can confuse the user (and results in things like Heroku's nodejs buildpack outputting an extra warning suggesting it might be the cause of problems).

Whilst this is isn't our fault we should add some additional (duplicate) dependency declarations to avoid these warnings.

$ yarn add neutrino @neutrinojs/react
...
warning "@neutrinojs/react > @neutrinojs/compile-loader > babel-loader@7.1.4" has unmet peer dependency "webpack@2 || 3 || 4".
warning "@neutrinojs/react > eslint-plugin-react@7.7.0" has unmet peer dependency "eslint@^3.0.0 || ^4.0.0".
$ yarn add neutrino @neutrinojs/preact
...
warning "@neutrinojs/preact > eslint-plugin-react@7.7.0" has unmet peer dependency "eslint@^3.0.0 || ^4.0.0".
warning "@neutrinojs/preact > @neutrinojs/compile-loader > babel-loader@7.1.4" has unmet peer dependency "webpack@2 || 3 || 4".
$ yarn add neutrino @neutrinojs/vue
...
warning "@neutrinojs/vue > eslint-plugin-react@7.7.0" has unmet peer dependency "eslint@^3.0.0 || ^4.0.0".
warning "@neutrinojs/vue > eslint-plugin-vue > vue-eslint-parser@2.0.3" has unmet peer dependency "eslint@>=3.9.0".
warning "@neutrinojs/vue > eslint-plugin-vue@4.3.0" has unmet peer dependency "eslint@^3.18.0 || ^4.0.0".
warning "@neutrinojs/vue > vue-loader@13.7.1" has unmet peer dependency "css-loader@*".
$ yarn add neutrino @neutrinojs/airbnb
...
warning "@neutrinojs/airbnb > eslint-config-airbnb > eslint-config-airbnb-base@12.1.0" has unmet peer dependency "eslint@^4.9.0".
warning "@neutrinojs/airbnb > eslint-config-airbnb@16.1.0" has unmet peer dependency "eslint-plugin-react@^7.4.0".
warning "@neutrinojs/airbnb > eslint-config-airbnb@16.1.0" has unmet peer dependency "eslint@^4.9.0".
warning "@neutrinojs/airbnb > eslint-plugin-import@2.9.0" has unmet peer dependency "eslint@2.x - 4.x".
warning "@neutrinojs/airbnb > eslint-plugin-jsx-a11y@6.0.3" has unmet peer dependency "eslint@^3 || ^4".
$ yarn add neutrino @neutrinojs/airbnb-base
...
warning "@neutrinojs/airbnb-base > eslint-config-airbnb-base@12.1.0" has unmet peer dependency "eslint@^4.9.0".
warning "@neutrinojs/airbnb-base > eslint-plugin-import@2.9.0" has unmet peer dependency "eslint@2.x - 4.x".
$ yarn add neutrino @neutrinojs/standardjs
...
warning "@neutrinojs/standardjs > eslint-config-standard-jsx@4.0.2" has unmet peer dependency "eslint@>=3.19.0".
warning "@neutrinojs/standardjs > eslint-config-standard@10.2.1" has unmet peer dependency "eslint@>=3.19.0".
warning "@neutrinojs/standardjs > eslint-plugin-import@2.9.0" has unmet peer dependency "eslint@2.x - 4.x".
warning "@neutrinojs/standardjs > eslint-plugin-node@5.2.1" has unmet peer dependency "eslint@>=3.1.0".
warning "@neutrinojs/standardjs > eslint-plugin-react@7.7.0" has unmet peer dependency "eslint@^3.0.0 || ^4.0.0".
warning "@neutrinojs/standardjs > eslint-plugin-standard@3.0.1" has unmet peer dependency "eslint@>=3.19.0".
$ yarn add neutrino @neutrinojs/stylelint
...
warning "@neutrinojs/stylelint > stylelint-webpack-plugin@0.10.3" has unmet peer dependency "webpack@^3 || ^2 || ^2.2.0-rc.0 || ^2.1.0-beta.0 || ^1.13.2".
$ yarn add neutrino @neutrinojs/jest
...
warning "@neutrinojs/jest > eslint-plugin-jest@21.15.0" has unmet peer dependency "eslint@>=3.6".
@edmorley edmorley self-assigned this Mar 16, 2018
edmorley added a commit that referenced this issue Mar 19, 2018
Yarn doesn't take into account hoisting when displaying unmet peer
dependency warnings, so this adds explicit top-level dependencies
on packages that were being pulled in via sub-dependencies.

Fixes #751.
edmorley added a commit that referenced this issue Mar 22, 2018
The monorepo development equivalent of #751.

Fixes #759.
@mehta0056
Copy link

Hi, I am getting below error msg when I tried to install dependencies using yarn Install.

Some peer dependencies are incorrectly met; run yarn explain peer-requirements for details.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants