You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add command-line argument to hide dedupe warnings - #7094
yarn's "could be deduped from" warnings are unhelpful, noisy, and annoying. There's no clear path to fixing them and the deluge of output obfuscates other issues that would normally be seen easily. This commit adds a simple command-line flag to suppress these warnings from appearing in the output and the final count.
Before this change, yarn check would result in hundreds of warnings in our project:
$ yarn check
yarn check v1.13.0
warning Resolution field "braces@2.3.1" is incompatible with requested version "braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "braces@^0.1.2"
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
warning "@babel/helper-create-class-features-plugin##@babel/core@^7.0.0" could be deduped from "7.3.4" to "@babel\\core@7.3.4"
warning "@babel/plugin-transform-async-to-generator##@babel/core@^7.0.0-0" could be deduped from "7.3.4" to "@babel\\core@7.3.4"
warning "@babel/plugin-transform-block-scoping##@babel/core@^7.0.0-0" could be deduped from "7.3.4" to "@babel\\core@7.3.4"
warning "@babel/plugin-transform-classes##@babel/core@^7.0.0-0" could be deduped from "7.3.4" to "@babel\\core@7.3.4"
warning "@babel/plugin-transform-modules-systemjs##@babel/core@^7.0.0-0" could be deduped from "7.3.4" to "@babel\\core@7.3.4"
...
warning "istanbul-reports#handlebars#async@^2.5.0" could be deduped from "2.6.2" to "async@2.6.2"
warning "jest-jasmine2#jest-each#chalk@^2.0.1" could be deduped from "2.4.2" to "chalk@2.4.2"
warning "@storybook/mantra-core#@storybook/react-simple-di##prop-types@^15.6.0" could be deduped from "15.7.2" to "prop-types@15.7.2"
warning "react-treebeard#velocity-react#prop-types@^15.5.8" could be deduped from "15.7.2" to "prop-types@15.7.2"
info Found 295 warnings.
success Folder in sync.
Done in 11.38s.
After this change, only legitimate warnings are shown:
$ yarn check --no-dedupe-warnings
yarn check v1.16.0-0
warning Resolution field "braces@2.3.1" is incompatible with requested version "braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "braces@^0.1.2"
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
warning Resolution field "braces@2.3.1" is incompatible with requested version "karma#expand-braces#braces@^0.1.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "jest-cli#micromatch#braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "jest-config#micromatch#braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "test-exclude#micromatch#braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "jest-runtime#micromatch#braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "jest-message-util#micromatch#braces@^1.8.2"
warning Resolution field "braces@2.3.1" is incompatible with requested version "jest-haste-map#micromatch#braces@^1.8.2"
info Found 7 warnings.
success Folder in sync.
Done in 10.33s.
@arcanis Ah! I didn't realize that yarn check was being deprecated. We've been using it for several years now in our project and by this point, it's infiltrated a lot of our CI tasks and shell scripts to help developers avoid situations where their local packages are out of sync. It sounds like we should replace all those calls with yarn install instead. Is that the recommended approach from the yarn team?
Is that the recommended approach from the yarn team?
Yep. We also advise you to add --frozen-lockfile on your CI to block PRs that forgot to update the lockfile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
yarn's "could be deduped from" warnings are unhelpful, noisy, and annoying. There's no clear path to fixing them and the deluge of output obfuscates other issues that would normally be seen easily. This commit adds a simple command-line flag to suppress these warnings from appearing in the output and the final count.
More details and complaining here: #2287
Test plan
Before this change,
yarn checkwould result in hundreds of warnings in our project:After this change, only legitimate warnings are shown: