Skip to content

Yarn incorrectly warns about unmet peer dependencies #5347

@smikula

Description

@smikula

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
In some cases, yarn will report that a peer dependency is unmet even when that dependency is available (as demonstrated by examining node_modules or running yarn list).

If the current behavior is a bug, please provide the steps to reproduce.
The following is a simplified version of my scenario. I have the following package.json:

{
  "dependencies": {
    "@storybook/addon-actions": "^3.3.6",
    "@storybook/react": "^3.3.6",
    "babel-core": "^6.26.0",
    "react": "*",
    "react-dom": "*"
  }
}

When I run yarn I get the following warning (among others):

warning " > @storybook/[email protected]" has unmet peer dependency "@storybook/addons@^3.3.0".

However, @storybook/addons does get installed at an appropriate version:

>yarn list --pattern @storybook/addons
yarn list v1.4.1
warning package.json: No license field
warning No license field
└─ @storybook/[email protected]
Done in 0.92s.

This makes sense because @storybook/addons is a dependency of @storybook/react.

What is the expected behavior?
No peer dependency warning in this case.

Please mention your node.js, yarn and operating system version.
NodeJS: v8.7.0
Yarn: v1.4.1
OS: Windows 10

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions