-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Pin: table@4.0.2, because 4.0.3 needs "ajv": "^6.0.1", causing a conf… #10022
Pin: table@4.0.2, because 4.0.3 needs "ajv": "^6.0.1", causing a conf… #10022
Conversation
For the rest of the team: I'm still trying to get eslint-canary working properly so I can validate the ajv upgrade I've proposed some time ago in another PR. So this PR could silence the peer dependency warning until my PR is validated and merged. Besides the peer dependency warning being confusing, I don't think users experience any other harm (but @MS-elug please correct me if I'm wrong). |
The different version of "table" dependency is causing a conflict with eslint 4.18.1 that requires "ajv": "^5.3.0"
72d935a
to
632df43
Compare
While the warning is a bit annoying, everything actually works fine. The problem is that the ajv-keywords package gets lifted up to be at the same level as eslint’s ajv dependency. This causes npm to complain that the peer dependency ajv-keywords has on acc hasn’t been met. You can trigger the opposit warning after pinning with a project that requires both eslint and ajv 6. It’s an npm limitation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I would like to wait for more team members to review.
I think if we go deeper we can find a failing scenario, for this peerDependency issue. Fixing the version of table to 4.0.2 (that was the latest version available until 3days ago) solves our CI build failure. |
I'm confused about the issue. Why is the Based on #10022 (comment) it seems like this is a bug in npm. |
I just did As I expected I get the unmet peer dependency warning:
But when I run This is really just npm reporting an error that isn't really an error. It might still be worth fixing to not confuse downstream users but it's a not the case that something is broken. |
Right, I'm saying that this should be filed as a bug in npm, because it shouldn't arrange the dependencies in a manner such that this problem occurs. I'm fine with hacking around the problem in the meantime, but this seems like something that should be fixed in general. |
This missing peer dep will block any lock deps throught |
I'm not sure this is the case. Peer dependencies are logical dependency declarations only, and it's up to the top-level project to declare its own dependencies that resolve all required peer dependencies (in theory; in practice, this is a little more difficult since indirect dependencies may specify peer deps that their consuming projects don't fulfill). Put another way, npm only checks that ajv@^5.3.0 is available to ESLint, and ajv@^6.0.1 is available to table. This cannot be fulfilled with our current package.json. If anything, table (or one of its dependencies) should explicitly depend on ajv to fulfill the peer dependency and avoid the problem upstream. If this was a dependency issue rather than peer dependency, I would agree this is an npm issue. But in this case, I'm not sure it's an npm issue. Let me know if I'm missing something. |
If some version Whether table needs to peer-depend on ajv versus depend on it is separate; but at the moment, that's how it is. |
@platinumazure Not quite. The situation is the following: npm arranges theses packages in the following way eslint
Because ajv-keywords@3.0.0 is on the same level as ajv@5.5.2, npm shows this warnings as ajv@5.5.2 is not in range for the ajv-keywords peer dependency. But when table loads ajv it correctly gets ajv@6.2.0 which does work with ajv-keywords@3.0.0 @ljharb table does not have a peer dependency on ajv. One its dependencies, ajv-keywords, does. |
@realityking ah, thanks. then in that case, |
@ljharb I'm not sure I follow. |
:-/ hmm, in that case i have no idea why this is causing an issue for eslint. This does seem more like a bug in npm, provided |
@ljharb See the first part #10022 (comment). Because |
Right; because |
Seems my comment was in error. Sorry for the confusion, folks.
…On Feb 26, 2018 12:49 PM, "Jordan Harband" ***@***.***> wrote:
Right; because ajv-keywords has a peer dep, that's satisfied by one of
table's unhoisted deps, it's incorrect for npm to hoist it above table.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10022 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AARWetk5TOnMB3r1TlMwYhXlHajqUl7Sks5tYvy1gaJpZM4STlh1>
.
|
@ljharb this is a known issue in npm, unfortuantely. The hoisting algorithm doesn't currently consider whether a package's peer dependencies will be satisfied when hoisting it. There was a quick/dirty fix in npm 5.2.0 but they rolled it back in 5.3.0 because they wanted to fix it properly & the naive fix broke users with questionable dependency workflows. |
Encountered this issue on standard too: standard/standard#1078 (comment) |
…lict with eslint 4.18.1 that requires "ajv": "^5.3.0"
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain: Update package json to avoid peerDependency issue due to the latest release of "table"
What changes did you make? (Give an overview)
Pin: table@4.0.2, because 4.0.3 needs "ajv": "^6.0.1", causing a conflict with eslint 4.18.1 that requires "ajv": "^5.3.0"
Is there anything you'd like reviewers to focus on?