Yarn: Use yarn-deduplicate to cleanup your yarn.lock

Updated . Posted . Visible to the public.

Note

Use yarn dedupe in Yarn v2+: https://yarnpkg.com/cli/dedupe Show archive.org snapshot

This package only works with Yarn v1. Yarn v2 supports package deduplication natively!

A duplicate package is when two dependencies are resolved to a different version, even when a single version matches the range specified in the dependencies. See the Deduplication strategies section for a few examples.

Yarn is stupid, so it can happen that there are several version of the same package in your bundle, although one would fulfill your conditions:

"@babel/code-frame@^7.0.0":
  version "7.8.3"
  resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e"

"@babel/code-frame@^7.12.13":
  version "7.12.13"
  resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658"

yarn-deduplicate will help you with that and merges the two entries above:

"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13":
  version "7.12.13"
  resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658"
Florian Leinsinger
Last edit
Florian Leinsinger
License
Source code in this card is licensed under the MIT License.
Posted by Florian Leinsinger to makandra dev (2022-08-17 14:27)