Skip to content

"unmet peer dependency" warning shown for transitive dependency that npm accepts #4675

@edmorley

Description

@edmorley

Hi!

Do you want to request a feature or report a bug?
A bug.

STR:

  1. Clone https://github.com/edmorley/yarn-unmet-peerdependency-testcase
  2. From the repo root, run: rm -rf node_modules/ && yarn install
  3. And then: rm -rf node_modules/ && npm install

Expected:

  • unmet peer dependency warnings aren't shown for dependencies that are installed transitively.
  • yarn and npm errors/warnings are roughly the same for the same package.json.

Actual:
The yarn output (example) includes:

warning "[email protected]" has unmet peer dependency "eslint@^4.8.0".
warning "[email protected]" has unmet peer dependency "[email protected] - 4.x".

...whereas the NPM output (example) contains no such warnings.

To save having to dig through the repo, the testcase's package.json contains:

  "dependencies": {
    "neutrino": "7.1.0",
    "neutrino-preset-airbnb-base": "7.1.0"
}

...and the relevant child package's dependencies are as follows:

// neutrino-preset-airbnb-base
// https://github.com/mozilla-neutrino/neutrino-dev/blob/v7.1.0/packages/neutrino-preset-airbnb-base/package.json
  "dependencies": {
    ...
    "eslint-config-airbnb-base": "^12.0.1",
    "eslint-plugin-import": "^2.7.0",
    "neutrino-middleware-eslint": "^7.1.0"
  },

// neutrino-middleware-eslint
// https://github.com/mozilla-neutrino/neutrino-dev/blob/v7.1.0/packages/neutrino-middleware-eslint/package.json
  "dependencies": {
    ...
    "eslint": "^4.7.2",
    ...
  },

Please mention your node.js, yarn and operating system version.
yarn 1.2.0 / npm 5.4.2
node 8.6.0
Windows 10 x64 using MSYS2 bash.

Many thanks :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions