Skip to content

yarn check reports errors after install succeeds #3916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
haines opened this issue Jul 12, 2017 · 2 comments
Closed

yarn check reports errors after install succeeds #3916

haines opened this issue Jul 12, 2017 · 2 comments

Comments

@haines
Copy link

haines commented Jul 12, 2017

Do you want to request a feature or report a bug?
Report a bug 🐛

What is the current behavior?
yarn check reports errors after a fresh and seemingly correct install.

If the current behavior is a bug, please provide the steps to reproduce.
Distilled from webpack/webpack#5262:

$ yarn init --yes
$ yarn add [email protected] [email protected]
$ yarn check
yarn check v0.27.5
error "ajv" is wrong version: expected "4.11.8", got "5.2.2"
error "webpack#ajv" not installed
warning "chokidar#fsevents#node-pre-gyp@^0.6.36" could be deduped from "0.6.36" to "[email protected]"
error Found 2 errors.

What is the expected behavior?
yarn check does not report errors.

It appears the problem is that [email protected] depends on ajv@^5.1.5 and transitively on ajv@^4.9.1, while [email protected] transitively depends on ajv@^4.7.0.

$ yarn why ajv
info Has been hoisted to "ajv"
info Reasons this module exists
   - "eslint#table" depends on it
   - "webpack#watchpack#chokidar#fsevents#node-pre-gyp#request#har-validator" depends on it

The install appears correct, though; yarn.lock contains two resolved versions for ajv:

ajv@^4.7.0, ajv@^4.9.1:
  version "4.11.8"

ajv@^5.1.5:
  version "5.2.2"

[email protected] is installed in node_modules:

$ jq .version node_modules/ajv/package.json
"5.2.2"

[email protected] is installed in node_modules/har-validator/node_modules and node_modules/table/node_modules:

$ jq .version node_modules/har-validator/node_modules/ajv/package.json
"4.11.8"
$ jq .version node_modules/table/node_modules/ajv/package.json
"4.11.8"

The transitive aspect appears to be key,

does not cause this error; interestingly, it installs [email protected] to node_modules and [email protected] to node_modules/webpack/node_modules.

Please mention your node.js, yarn and operating system version.
Node 6.10.3
Yarn 0.27.5
Mac OS X 10.12.5

@CrabDude
Copy link
Contributor

Recommend closing this in favor of #3933, which contains a generalized reproduction (not specific to webpack) and a lengthy explanation of the rationale for treating peerDependencies as npm does.

@haines
Copy link
Author

haines commented Jul 20, 2017

Closing in favour of #3933

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

No branches or pull requests

2 participants