CINXE.COM
<!doctype html> <html x-doc-route="/cli/dedupe" lang="en" dir="ltr" class="docs-wrapper plugin-yarn-cli-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-cli/dedupe" data-has-hydrated="false"> <head> <meta charset="UTF-8"> <meta name="generator" content="Docusaurus v3.4.0"> <title data-rh="true">yarn dedupe | Yarn</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://yarnpkg.com/img/social-preview.png"><meta data-rh="true" name="twitter:image" content="https://yarnpkg.com/img/social-preview.png"><meta data-rh="true" property="og:url" content="https://yarnpkg.com/cli/dedupe"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="yarn dedupe | Yarn"><meta data-rh="true" name="description" content="Deduplicate dependencies with overlapping ranges."><meta data-rh="true" property="og:description" content="Deduplicate dependencies with overlapping ranges."><link data-rh="true" rel="icon" href="/img/yarn-favicon.svg"><link data-rh="true" rel="canonical" href="https://yarnpkg.com/cli/dedupe"><link data-rh="true" rel="alternate" href="https://yarnpkg.com/cli/dedupe" hreflang="en"><link data-rh="true" rel="alternate" href="https://yarnpkg.com/cli/dedupe" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://STXW7VT1S5-dsn.algolia.net" crossorigin="anonymous"><link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="Yarn RSS Feed"> <link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="Yarn Atom Feed"> <link rel="search" type="application/opensearchdescription+xml" title="Yarn" href="/opensearch.xml"> <script src="/js/custom.js"></script><link rel="stylesheet" href="/assets/css/styles.1549fd9f.css"> <script src="/assets/js/runtime~main.a21f5afc.js" defer="defer"></script> <script src="/assets/js/main.24dfa3e2.js" defer="defer"></script> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var[t,e]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_VNyr" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyBpZD0iTGF5ZXJfMSIgdmlld0JveD0iMCAwIDExNTQuOCA1MTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHN0eWxlPi5zdDB7ZmlsbDojZmZmfS5zdDF7ZmlsbDpyZWR9PC9zdHlsZT4KICA8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNzE4LjYgMjU3LjhjLTggMjcuNi0yMC44IDQ3LjYtMzUuMiA2My42VjE4MWMwLTkuNi04LjQtMTcuNi0yMS42LTE3LjYtNS42IDAtMTAuNCAyLjgtMTAuNCA2LjggMCAyLjggMS42IDUuMiAxLjYgMTIuOHY2NC40Yy00Lj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EMgMTUxLjIgMzEzLjkgMTQ4IDI4OS44IDE1OC41IDI2NS4xIEMgMTY4IDI0Mi42IDE5My42IDIyNC41IDE5My42IDIyNC41IEMgMTkzLjYgMjI0LjUgMTcyLjEgMjAwLjcgMTgwLjEgMTc5LjMgQyAxODUuMyAxNjUuMyAxODcuNCAxNjUuNCAxODkuMSAxNjQuOCBDIDE5NS4xIDE2Mi41IDIwMC45IDE2MCAyMDUuMiAxNTUuMyBDIDIyNi43IDEzMi4xIDI1NC4xIDEzNi41IDI1NC4xIDEzNi41IEMgMjU0LjEgMTM2LjUgMjY3LjEgOTcgMjc5LjEgMTA0LjcgQyAyODIuOCAxMDcuMSAyOTYuMSAxMzYuNyAyOTYuMSAxMzYuNyBDIDI5Ni4xIDEzNi43IDMxMC4zIDEyOC40IDMxMS45IDEzMS41IEMgMzIwLjUgMTQ4LjIgMzIxLjUgMTgwLjEgMzE3LjcgMTk5LjUgQyAzMTEuMyAyMzEuNSAyOTUuMyAyNDguNyAyODguOSAyNTkuNSBDIDI4Ny40IDI2MiAzMDYuMSAyNjkuOSAzMTcuOSAzMDIuNiBDIDMyOC44IDMzMi41IDMxOS4xIDM1Ny42IDMyMC44IDM2MC40IEMgMzIxLjEgMzYwLjkgMzIxLjIgMzYxLjEgMzIxLjIgMzYxLjEgQyAzMjEuMiAzNjEuMSAzMzMuNyAzNjIuMSAzNTguOCAzNDYuNiBDIDM3Mi4yIDMzOC4zIDM4OC4xIDMyOSA0MDYuMiAzMjguOCBDIDQyMy43IDMyOC41IDQyNC42IDM0OSA0MTEuNCAzNTIuMiBaIi8+Cjwvc3ZnPg==" alt="Yarn Logo" class="themedComponent_u5Ak themedComponent--dark_Ka8T"></div><b class="navbar__title text--truncate">Yarn</b></a><a class="navbar__item navbar__link" href="/getting-started">Get Started</a><a class="navbar__item navbar__link" href="/features/caching">Features</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/cli">CLI</a><a class="navbar__item navbar__link" href="/configuration/manifest">Configuration</a><a class="navbar__item navbar__link" href="/advanced/error-codes">Advanced</a><a class="navbar__item navbar__link" href="/blog">Blog</a><a class="navbar__item navbar__link" href="/api">API</a></div><div class="navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a class="navbar__link" aria-haspopup="true" aria-expanded="false" role="button" href="/getting-started">master (4.9.0-dev)</a><ul class="dropdown__menu"><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/getting-started">master (4.9.0-dev)</a></li><li><a href="https://v3.yarnpkg.com" target="_blank" rel="noopener noreferrer" class="dropdown__link">3.8.7<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_XYcw"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://classic.yarnpkg.com/en/docs" target="_blank" rel="noopener noreferrer" class="dropdown__link">1.22.22<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_XYcw"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><a href="https://discord.gg/yarnpkg" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Discord<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_XYcw"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><a href="https://github.com/yarnpkg/berry" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_XYcw"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><div class="navbarSearchContainer_Lyxt"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_CMyW"><div class="docsWrapper_bSxm"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_69Hm" type="button"></button><div class="docRoot_cWv0"><aside class="theme-doc-sidebar-container docSidebarContainer_Sb1_"><div class="sidebarViewport_l2Qt"><div class="sidebar_H7mn"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_sbrg"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--active" href="/cli">@yarnpkg/cli</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/add">yarn add</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/bin">yarn bin</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/cache/clean">yarn cache clean</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/config">yarn config</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/config/get">yarn config get</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/config/set">yarn config set</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/config/unset">yarn config unset</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/constraints">yarn constraints</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/constraints/query">yarn constraints query</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/constraints/source">yarn constraints source</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/cli/dedupe">yarn dedupe</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/dlx">yarn dlx</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/exec">yarn exec</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/explain">yarn explain</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/explain/peer-requirements">yarn explain peer-requirements</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/info">yarn info</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/init">yarn init</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/init">yarn init</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/install">yarn install</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/link">yarn link</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/node">yarn node</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/npm/audit">yarn npm audit</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/npm/info">yarn npm info</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/npm/login">yarn npm login</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/npm/logout">yarn npm logout</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/npm/publish">yarn npm publish</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/npm/tag/add">yarn npm tag add</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/npm/tag/list">yarn npm tag list</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/npm/tag/remove">yarn npm tag remove</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/npm/whoami">yarn npm whoami</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/pack">yarn pack</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/patch">yarn patch</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/patch-commit">yarn patch-commit</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/plugin/check">yarn plugin check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/plugin/import">yarn plugin import</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/plugin/import/from/sources">yarn plugin import from sources</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/plugin/list">yarn plugin list</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/plugin/remove">yarn plugin remove</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/plugin/runtime">yarn plugin runtime</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/rebuild">yarn rebuild</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/remove">yarn remove</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/run">yarn run</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/search">yarn search</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/set/resolution">yarn set resolution</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/set/version">yarn set version</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/set/version/from/sources">yarn set version from sources</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/stage">yarn stage</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/unlink">yarn unlink</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/unplug">yarn unplug</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/up">yarn up</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/upgrade-interactive">yarn upgrade-interactive</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/version">yarn version</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/version/apply">yarn version apply</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/version/check">yarn version check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/why">yarn why</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/workspace">yarn workspace</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/workspaces/focus">yarn workspaces focus</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/workspaces/foreach">yarn workspaces foreach</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/workspaces/list">yarn workspaces list</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link" href="/cli/builder">@yarnpkg/builder</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/builder/build/bundle">yarn builder build bundle</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/builder/build/plugin">yarn builder build plugin</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/builder/new/plugin">yarn builder new plugin</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link" href="/cli/pnpify">@yarnpkg/pnpify</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/pnpify/run">yarn pnpify run</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link" href="/cli/sdks">@yarnpkg/sdks</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/cli/sdks/default">yarn sdks</a></li></ul></li></ul></nav></div></div></aside><main class="docMainContainer_mc2i"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_OnZ6"><div class="docItemContainer_I85P"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_jPbZ" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_shmk"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/cli"><span itemprop="name">@yarnpkg/cli</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">yarn dedupe</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_atEM theme-doc-toc-mobile tocMobile_rFVJ"><button type="button" class="clean-btn tocCollapsibleButton_FCxV">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>yarn dedupe</h1></header><div class="subtitle"><p>Deduplicate dependencies with overlapping ranges.</p></div> <h2 class="anchor anchorWithStickyNavbar_ATBP" id="usage">Usage<a class="hash-link" aria-label="Direct link to Usage" title="Direct link to Usage" href="/cli/dedupe#usage"></a></h2> <div class="terminal-code"><pre tabindex="0" class="codeBlockStandalone_xQ8c thin-scrollbar codeBlockContainer_EXcq theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><code class="codeBlockLines_PG5o"><div><span style="font-weight:bold;user-select:none">$ </span>yarn dedupe ...</div></code></pre></div> <h2 class="anchor anchorWithStickyNavbar_ATBP" id="examples">Examples<a class="hash-link" aria-label="Direct link to Examples" title="Direct link to Examples" href="/cli/dedupe#examples"></a></h2> <p>Dedupe all packages :</p> <pre class="block_WSSz"><code><div><span class="token_Ye2a" data-type="binary">yarn</span> <a class="path_tCL7" data-tooltip-id="tooltip" data-tooltip-content="Deduplicate dependencies with overlapping ranges " href="/cli/dedupe"><span class="token_Ye2a" data-type="path">dedupe</span></a></div></code></pre> <p>Dedupe all packages using a specific strategy :</p> <pre class="block_WSSz"><code><div><span class="token_Ye2a" data-type="binary">yarn</span> <a class="path_tCL7" data-tooltip-id="tooltip" data-tooltip-content="Deduplicate dependencies with overlapping ranges " href="/cli/dedupe"><span class="token_Ye2a" data-type="path">dedupe</span></a> <span class="token_Ye2a" data-type="dash">--</span><span class="token_Ye2a" data-type="option" data-tooltip-id="tooltip" data-tooltip-content="The strategy to use when deduping dependencies">strategy</span> <span class="token_Ye2a" data-type="value">highest</span></div></code></pre> <p>Dedupe a specific package :</p> <pre class="block_WSSz"><code><div><span class="token_Ye2a" data-type="binary">yarn</span> <a class="path_tCL7" data-tooltip-id="tooltip" data-tooltip-content="Deduplicate dependencies with overlapping ranges " href="/cli/dedupe"><span class="token_Ye2a" data-type="path">dedupe</span></a> <span class="token_Ye2a" data-type="positional">lodash</span></div></code></pre> <p>Dedupe all packages with the <code>@babel/*</code> scope :</p> <pre class="block_WSSz"><code><div><span class="token_Ye2a" data-type="binary">yarn</span> <a class="path_tCL7" data-tooltip-id="tooltip" data-tooltip-content="Deduplicate dependencies with overlapping ranges " href="/cli/dedupe"><span class="token_Ye2a" data-type="path">dedupe</span></a> <span class="token_Ye2a" data-type="positional">@babel/*</span></div></code></pre> <p>Check for duplicates (can be used as a CI step) :</p> <pre class="block_WSSz"><code><div><span class="token_Ye2a" data-type="binary">yarn</span> <a class="path_tCL7" data-tooltip-id="tooltip" data-tooltip-content="Deduplicate dependencies with overlapping ranges " href="/cli/dedupe"><span class="token_Ye2a" data-type="path">dedupe</span></a> <span class="token_Ye2a" data-type="dash">--</span><span class="token_Ye2a" data-type="option" data-tooltip-id="tooltip" data-tooltip-content="Exit with exit code 1 when duplicates are found, without persisting the dependency tree">check</span></div></code></pre> <h2 class="anchor anchorWithStickyNavbar_ATBP" id="details">Details<a class="hash-link" aria-label="Direct link to Details" title="Direct link to Details" href="/cli/dedupe#details"></a></h2> <p>Duplicates are defined as descriptors with overlapping ranges being resolved and locked to different locators. They are a natural consequence of Yarn's deterministic installs, but they can sometimes pile up and unnecessarily increase the size of your project.</p> <p>This command dedupes dependencies in the current project using different strategies (only one is implemented at the moment):</p> <ul> <li><code>highest</code>: Reuses (where possible) the locators with the highest versions. This means that dependencies can only be upgraded, never downgraded. It's also guaranteed that it never takes more than a single pass to dedupe the entire dependency tree.</li> </ul> <p><strong>Note:</strong> Even though it never produces a wrong dependency tree, this command should be used with caution, as it modifies the dependency tree, which can sometimes cause problems when packages don't strictly follow semver recommendations. Because of this, it is recommended to also review the changes manually.</p> <p>If set, the <code>-c,--check</code> flag will only report the found duplicates, without persisting the modified dependency tree. If changes are found, the command will exit with a non-zero exit code, making it suitable for CI purposes.</p> <p>If the <code>--mode=<mode></code> option is set, Yarn will change which artifacts are generated. The modes currently supported are:</p> <ul> <li> <p><code>skip-build</code> will not run the build scripts at all. Note that this is different from setting <code>enableScripts</code> to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.</p> </li> <li> <p><code>update-lockfile</code> will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.</p> </li> </ul> <p>This command accepts glob patterns as arguments (if valid Idents and supported by <a href="https://github.com/micromatch/micromatch" target="_blank" rel="noopener noreferrer">micromatch</a>). Make sure to escape the patterns, to prevent your own shell from trying to expand them.</p> <h3 class="anchor anchorWithStickyNavbar_ATBP" id="in-depth-explanation">In-depth explanation:<a class="hash-link" aria-label="Direct link to In-depth explanation:" title="Direct link to In-depth explanation:" href="/cli/dedupe#in-depth-explanation"></a></h3> <p>Yarn doesn't deduplicate dependencies by default, otherwise installs wouldn't be deterministic and the lockfile would be useless. What it actually does is that it tries to not duplicate dependencies in the first place.</p> <p><strong>Example:</strong> If <code>foo@^2.3.4</code> (a dependency of a dependency) has already been resolved to <code>foo@2.3.4</code>, running <span class="inline_hdsZ"><code><span class="token_Ye2a" data-type="binary">yarn</span> <a class="path_tCL7" data-tooltip-id="tooltip" data-tooltip-content="Add dependencies to the project " href="/cli/add"><span class="token_Ye2a" data-type="path">add</span></a> <span class="token_Ye2a" data-type="positional">foo@*</span></code></span>will cause Yarn to reuse <code>foo@2.3.4</code>, even if the latest <code>foo</code> is actually <code>foo@2.10.14</code>, thus preventing unnecessary duplication.</p> <p>Duplication happens when Yarn can't unlock dependencies that have already been locked inside the lockfile.</p> <p><strong>Example:</strong> If <code>foo@^2.3.4</code> (a dependency of a dependency) has already been resolved to <code>foo@2.3.4</code>, running <span class="inline_hdsZ"><code><span class="token_Ye2a" data-type="binary">yarn</span> <a class="path_tCL7" data-tooltip-id="tooltip" data-tooltip-content="Add dependencies to the project " href="/cli/add"><span class="token_Ye2a" data-type="path">add</span></a> <span class="token_Ye2a" data-type="positional">foo@2.10.14</span></code></span> will cause Yarn to install <code>foo@2.10.14</code> because the existing resolution doesn't satisfy the range <code>2.10.14</code>. This behavior can lead to (sometimes) unwanted duplication, since now the lockfile contains 2 separate resolutions for the 2 <code>foo</code> descriptors, even though they have overlapping ranges, which means that the lockfile can be simplified so that both descriptors resolve to <code>foo@2.10.14</code>.</p> <h2 class="anchor anchorWithStickyNavbar_ATBP" id="options">Options<a class="hash-link" aria-label="Direct link to Options" title="Direct link to Options" href="/cli/dedupe#options"></a></h2> <table><thead><tr><th>Definition</th><th>Description</th></tr></thead><tbody><tr><td><h4 id="options-s%2C-strategy%20%230" class="header-code"><code class="language-text">-s,--strategy #0</code></h4></td><td>The strategy to use when deduping dependencies</td></tr><tr><td><h4 id="options-c%2C-check" class="header-code"><code class="language-text">-c,--check</code></h4></td><td>Exit with exit code 1 when duplicates are found, without persisting the dependency tree</td></tr><tr><td><h4 id="options-json" class="header-code"><code class="language-text">--json</code></h4></td><td>Format the output as an NDJSON stream</td></tr><tr><td><h4 id="options-mode%20%230" class="header-code"><code class="language-text">--mode #0</code></h4></td><td>Change what artifacts installs generate</td></tr></tbody></table></div></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"></nav></div></div><div class="col col--3"><div class="tableOfContents_Pn2_ thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a class="table-of-contents__link toc-highlight" href="/cli/dedupe#usage">Usage</a></li><li><a class="table-of-contents__link toc-highlight" href="/cli/dedupe#examples">Examples</a></li><li><a class="table-of-contents__link toc-highlight" href="/cli/dedupe#details">Details</a><ul><li><a class="table-of-contents__link toc-highlight" href="/cli/dedupe#in-depth-explanation">In-depth explanation:</a></li></ul></li><li><a class="table-of-contents__link toc-highlight" href="/cli/dedupe#options">Options</a></li></ul></div></div></div></div></main></div></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2025 Yarn Contributors, Inc. Built with Docusaurus.</div></div></div></footer></div> </body> </html>