CINXE.COM
<!doctype html> <html x-doc-route="/cli/install" lang="en" dir="ltr" class="docs-wrapper plugin-yarn-cli-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-cli/install" data-has-hydrated="false"> <head> <meta charset="UTF-8"> <meta name="generator" content="Docusaurus v3.4.0"> <title data-rh="true">yarn install | 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/install"><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 install | Yarn"><meta data-rh="true" name="description" content="Install the project dependencies."><meta data-rh="true" property="og:description" content="Install the project dependencies."><link data-rh="true" rel="icon" href="/img/yarn-favicon.svg"><link data-rh="true" rel="canonical" href="https://yarnpkg.com/cli/install"><link data-rh="true" rel="alternate" href="https://yarnpkg.com/cli/install" hreflang="en"><link data-rh="true" rel="alternate" href="https://yarnpkg.com/cli/install" 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.ed540d95.js" defer="defer"></script> <script src="/assets/js/main.8d1417ce.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+CiAgPHN0eWxlPi5zdDB7ZmlsbDojZmZmfS5zdDF7ZmlsbDpyZWR9PC9zdHlsZT4KICA8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNzE4LjYgMjU3LjhjLTggMjcuNi0yMC44IDQ3LjYtMzUuMiA2My42VjE4MWMwLTkuNi04LjQtMTcuNi0yMS42LTE3LjYtNS42IDAtMTAuNCAyLjgtMTAuNCA2LjggMCAyLjggMS42IDUuMiAxLjYgMTIuOHY2NC40Yy00LjggMjgtMTYuOCA1NC0zMi44IDU0LTExLjYgMC0xOC40LTExLjYtM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IEMgMTY4IDI0Mi42IDE5My42IDIyNC41IDE5My42IDIyNC41IEMgMTkzLjYgMjI0LjUgMTcyLjEgMjAwLjcgMTgwLjEgMTc5LjMgQyAxODUuMyAxNjUuMyAxODcuNCAxNjUuNCAxODkuMSAxNjQuOCBDIDE5NS4xIDE2Mi41IDIwMC45IDE2MCAyMDUuMiAxNTUuMyBDIDIyNi43IDEzMi4xIDI1NC4xIDEzNi41IDI1NC4xIDEzNi41IEMgMjU0LjEgMTM2LjUgMjY3LjEgOTcgMjc5LjEgMTA0LjcgQyAyODIuOCAxMDcuMSAyOTYuMSAxMzYuNyAyOTYuMSAxMzYuNyBDIDI5Ni4xIDEzNi43IDMxMC4zIDEyOC40IDMxMS45IDEzMS41IEMgMzIwLjUgMTQ4LjIgMzIxLjUgMTgwLjEgMzE3LjcgMTk5LjUgQyAzMTEuMyAyMzEuNSAyOTUuMyAyNDguNyAyODguOSAyNTkuNSBDIDI4Ny40IDI2MiAzMDYuMSAyNjkuOSAzMTcuOSAzMDIuNiBDIDMyOC44IDMzMi41IDMxOS4xIDM1Ny42IDMyMC44IDM2MC40IEMgMzIxLjEgMzYwLjkgMzIxLjIgMzYxLjEgMzIxLjIgMzYxLjEgQyAzMjEuMiAzNjEuMSAzMzMuNyAzNjIuMSAzNTguOCAzNDYuNiBDIDM3Mi4yIDMzOC4zIDM4OC4xIDMyOSA0MDYuMiAzMjguOCBDIDQyMy43IDMyOC41IDQyNC42IDM0OSA0MTEuNCAzNTIuMiBaIi8+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.5.3-dev)</a><ul class="dropdown__menu"><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/getting-started">master (4.5.3-dev)</a></li><li><a href="https://v3.yarnpkg.com" target="_blank" rel="noopener noreferrer" class="dropdown__link">3.8.6<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" 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 menu__link--active" aria-current="page" 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 install</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 install</h1></header><div class="subtitle"><p>Install the project dependencies.</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/install#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 install</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/install#examples"></a></h2> <p>Install the project :</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="Install the project dependencies " href="/cli/install"><span class="token_Ye2a" data-type="path">install</span></a></div></code></pre> <p>Validate a project when using Zero-Installs :</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="Install the project dependencies " href="/cli/install"><span class="token_Ye2a" data-type="path">install</span></a> <span class="token_Ye2a" data-type="dash">--</span><span class="token_Ye2a" data-type="option" data-tooltip-id="tooltip" data-tooltip-content="Abort with an error exit code if the lockfile was to be modified">immutable</span> <span class="token_Ye2a" data-type="dash">--</span><span class="token_Ye2a" data-type="option" data-tooltip-id="tooltip" data-tooltip-content="Abort with an error exit code if the cache folder was to be modified">immutable-cache</span></div></code></pre> <p>Validate a project when using Zero-Installs (slightly safer if you accept external PRs) :</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="Install the project dependencies " href="/cli/install"><span class="token_Ye2a" data-type="path">install</span></a> <span class="token_Ye2a" data-type="dash">--</span><span class="token_Ye2a" data-type="option" data-tooltip-id="tooltip" data-tooltip-content="Abort with an error exit code if the lockfile was to be modified">immutable</span> <span class="token_Ye2a" data-type="dash">--</span><span class="token_Ye2a" data-type="option" data-tooltip-id="tooltip" data-tooltip-content="Abort with an error exit code if the cache folder was to be modified">immutable-cache</span> <span class="token_Ye2a" data-type="dash">--</span><span class="token_Ye2a" data-type="option" data-tooltip-id="tooltip" data-tooltip-content="Always refetch the packages and ensure that their checksums are consistent">check-cache</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/install#details"></a></h2> <p>This command sets up your project if needed. The installation is split into four different steps that each have their own characteristics:</p> <ul> <li> <p><strong>Resolution:</strong> First the package manager will resolve your dependencies. The exact way a dependency version is privileged over another isn't standardized outside of the regular semver guarantees. If a package doesn't resolve to what you would expect, check that all dependencies are correctly declared (also check our website for more information: ).</p> </li> <li> <p><strong>Fetch:</strong> Then we download all the dependencies if needed, and make sure that they're all stored within our cache (check the value of <code data-tooltip-id="tooltip" data-tooltip-content="Path where the downloaded packages are stored on your system."><a class="key_FEvO" href="/configuration/yarnrc#cacheFolder">cacheFolder</a></code> in <code>yarn config</code> to see where the cache files are stored).</p> </li> <li> <p><strong>Link:</strong> Then we send the dependency tree information to internal plugins tasked with writing them on the disk in some form (for example by generating the <code>.pnp.cjs</code> file you might know).</p> </li> <li> <p><strong>Build:</strong> Once the dependency tree has been written on the disk, the package manager will now be free to run the build scripts for all packages that might need it, in a topological order compatible with the way they depend on one another. See <a href="https://yarnpkg.com/advanced/lifecycle-scripts" target="_blank" rel="noopener noreferrer">https://yarnpkg.com/advanced/lifecycle-scripts</a> for detail.</p> </li> </ul> <p>Note that running this command is not part of the recommended workflow. Yarn supports zero-installs, which means that as long as you store your cache and your <code>.pnp.cjs</code> file inside your repository, everything will work without requiring any install right after cloning your repository or switching branches.</p> <p>If the <code>--immutable</code> option is set (defaults to true on CI), Yarn will abort with an error exit code if the lockfile was to be modified (other paths can be added using the <code data-tooltip-id="tooltip" data-tooltip-content="Array of file patterns whose content won't be allowed to change if `enableImmutableInstalls` is set."><a class="key_FEvO" href="/configuration/yarnrc#immutablePatterns">immutablePatterns</a></code> configuration setting). For backward compatibility we offer an alias under the name of <code>--frozen-lockfile</code>, but it will be removed in a later release.</p> <p>If the <code>--immutable-cache</code> option is set, Yarn will abort with an error exit code if the cache folder was to be modified (either because files would be added, or because they'd be removed).</p> <p>If the <code>--refresh-lockfile</code> option is set, Yarn will keep the same resolution for the packages currently in the lockfile but will refresh their metadata. If used together with <code>--immutable</code>, it can validate that the lockfile information are consistent. This flag is enabled by default when Yarn detects it runs within a pull request context.</p> <p>If the <code>--check-cache</code> option is set, Yarn will always refetch the packages and will ensure that their checksum matches what's 1/ described in the lockfile 2/ inside the existing cache files (if present). This is recommended as part of your CI workflow if you're both following the Zero-Installs model and accepting PRs from third-parties, as they'd otherwise have the ability to alter the checked-in packages before submitting them.</p> <p>If the <code>--inline-builds</code> option is set, Yarn will verbosely print the output of the build steps of your dependencies (instead of writing them into individual files). This is likely useful mostly for debug purposes only when using Docker-like environments.</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> <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/install#options"></a></h2> <table><thead><tr><th>Definition</th><th>Description</th></tr></thead><tbody><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-immutable" class="header-code"><code class="language-text">--immutable</code></h4></td><td>Abort with an error exit code if the lockfile was to be modified</td></tr><tr><td><h4 id="options-immutable-cache" class="header-code"><code class="language-text">--immutable-cache</code></h4></td><td>Abort with an error exit code if the cache folder was to be modified</td></tr><tr><td><h4 id="options-refresh-lockfile" class="header-code"><code class="language-text">--refresh-lockfile</code></h4></td><td>Refresh the package metadata stored in the lockfile</td></tr><tr><td><h4 id="options-check-cache" class="header-code"><code class="language-text">--check-cache</code></h4></td><td>Always refetch the packages and ensure that their checksums are consistent</td></tr><tr><td><h4 id="options-check-resolutions" class="header-code"><code class="language-text">--check-resolutions</code></h4></td><td>Validates that the package resolutions are coherent</td></tr><tr><td><h4 id="options-inline-builds" class="header-code"><code class="language-text">--inline-builds</code></h4></td><td>Verbosely print the output of the build steps of dependencies</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/install#usage">Usage</a></li><li><a class="table-of-contents__link toc-highlight" href="/cli/install#examples">Examples</a></li><li><a class="table-of-contents__link toc-highlight" href="/cli/install#details">Details</a></li><li><a class="table-of-contents__link toc-highlight" href="/cli/install#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 © 2024 Yarn Contributors, Inc. Built with Docusaurus.</div></div></div></footer></div> </body> </html>