Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

yarn

yarnpkg20.2mBSD-2-Clause1.22.22

šŸ“¦šŸˆ Fast, reliable, and secure dependency management.

readme

Yarn

Fast, reliable, and secure dependency management.

Circle Status Appveyor Status Azure Pipelines status Discord Chat Commitizen friendly


Fast: Yarn caches every package it has downloaded, so it never needs to download the same package again. It also does almost everything concurrently to maximize resource utilization. This means even faster installs.

Reliable: Using a detailed but concise lockfile format and a deterministic algorithm for install operations, Yarn is able to guarantee that any installation that works on one system will work exactly the same on another system.

Secure: Yarn uses checksums to verify the integrity of every installed package before its code is executed.

Features

  • Offline Mode. If you've installed a package before, then you can install it again without an internet connection.
  • Deterministic. The same dependencies will be installed in the same exact way on any machine, regardless of installation order.
  • Network Performance. Yarn efficiently queues requests and avoids request waterfalls in order to maximize network utilization.
  • Network Resilience. A single request that fails will not cause the entire installation to fail. Requests are automatically retried upon failure.
  • Flat Mode. Yarn resolves mismatched versions of dependencies to a single version to avoid creating duplicates.
  • More emojis. šŸˆ

Installing Yarn

Read the Installation Guide on our website for detailed instructions on how to install Yarn.

Using Yarn

Read the Usage Guide on our website for detailed instructions on how to use Yarn.

Contributing to Yarn

Contributions are always welcome, no matter how large or small. Substantial feature requests should be proposed as an RFC. Before contributing, please read the code of conduct.

See Contributing.

Prior art

Yarn wouldn't exist if it wasn't for excellent prior art. Yarn has been inspired by the following projects:

Credits

Thanks to Sam Holmes for donating the npm package name!

changelog

Changelog

Please add one entry in this file for each change in Yarn's behavior. Use the same format for all entries, including the third-person verb. Make sure you don't add more than one line of text to keep it clean. Thanks!

Master

1.19.2

  • Folders like .cache won't be pruned from the node_modules after each install.

    #7699 - Maƫl Nison

  • Correctly installs workspace child dependencies when workspace child not symlinked to root.

    #7289 - Daniel Tschinder

  • Makes running scripts with Plug'n Play possible on node 13.

    #7650 - Sander Verweij

  • Change run command to check cwd/node_modules/.bin for commands. Fixes run in workspaces.

    #7151 - Jeff Valore

1.19.1

Important: This release contains a cache bump. It will cause the very first install following the upgrade to take slightly more time, especially if you don't use the Offline Mirror feature. After that everything will be back to normal.

1.19.0

Important: This release contains a cache bump. It will cause the very first install following the upgrade to take slightly more time, especially if you don't use the Offline Mirror feature. After that everything will be back to normal.

  • Fixes a potential vulnerability regarding how the build artifacts are stored

    Reported by ChALkeR, fixed by Maƫl Nison

1.18.0

  • Suggests using the Yarn 2 development trunk on PnP-enabled projects

    #7512 - Maƫl Nison

  • Preserves linked packages when calling yarn create

    #7543 - Nick McCurdy

  • Fixes the offline mirror filenames when using Verdaccio

    #7499 - xv2

  • Fixes using link:. to refer to the package folder

    #7512 - Maƫl Nison

  • Runs the prepare lifecycle of git dependencies even if NODE_ENV is set to production.

    #7398 - John Firebaugh

  • Fixes the postversion lifecycle method not being called when using --no-git-tag-version.

    #7154 - Hampus TĆ„gerud

  • Ignores potentially large vscode keys in package.json to avoid E2BIG errors.

    #7419 - Eric Amodio

  • Enforces https for the Yarn and npm registries.

    #7393 - Maƫl Nison

  • Adds support for reading yarnPath from v2-produced .yarnrc.yml files.

    #7350 - Maƫl Nison

1.17.0

  • Adds prereleases flags and prerelease identifier to yarn version.

    #7336 - Daniel Seijo

  • Fixes audits when used with yarn add & yarn upgrade

    #7326 - David Sanders

  • Adds support for the --offline flag to yarn global add

    #7330 - Francis Crick

  • Yarn will tolerate Yaml at parse time. Full support isn't ready yet and will only come at the next major.

    #7300 - Maƫl Nison

  • Fixes a bug when using the link: protocol with a folder that doesn't contain a package.json

    #7337 - Maƫl Nison

1.16.0

1.15.2

The 1.15.1 doesn't exist due to a release hiccup.

  • Reverts a behavior causing boggus interactions between PowerShell and yarn global

    #6954 - briman0094

  • Fixes a bug where non-zero exit codes were converted to a generic 1 when running yarn run

    #6926 - Kyle Fang

  • Fixes production / development reporting when running yarn audit

    #6970 - Adam Richardson

1.15.0

  • Removes --scripts-prepend-node-path as Yarn's default behavior makes this obsolete

    #7057 - Jason Grout

  • Fixes the advisory link printed by yarn audit

    #7091 - Jakob Krigovsky

  • Fixes npm_config_ environment variable parsing to support those prefixed with underscore (ex: _auth)

    #7070 - Nicholas Boll

  • Fixes yarn upgrade --latest for dependencies using > or >= range specifier

    #7080 - Xukai Wu

  • Fixes --modules-folder handling in several places (ex: yarn check now respects --modules-folder)

    #6850 - Jeff Valore

  • Removes rootModuleFolders (internal variable which wasn't used anywhere)

    #6846 - Jeff Valore

  • Adds support for setting global-folder from .yarnrc files

    #7056 - Hsiao-nan Cheung

  • Makes yarn version cancellable via ctrl-c or empty string

    #7064 - Olle Lauri Bostrƶm

  • Adds support for yarn policies set-version berry

    #7041 - Maƫl Nison

  • Fixes yarn upgrade --scope when using exotic (github) dependencies

    #7017 - Jeff Valore

  • Fixes occasionally mismatching upper/lowecases of drive letters in win32 pnp check

    #7007 - Christoph Werner

  • Fixes the error reporting for non-HTTP network errors (such as invalid certificates)

    #6968 - Chih-Hsuan Yen

  • Changes the location where the --require ./.pnp.js flag gets added into NODE_OPTIONS: now at the front (bis)

    #6951 - John-David Dalton

  • Packages won't be auto-unplugged anymore if ignore-scripts is set in the yarnrc file

    #6983 - Micha Reiser

  • Enables displaying Emojis on Terminus by default

    #7093 - David Refoua

  • Run the engines check before executing run scripts.

    #7013 - Eloy DurƔn

1.14.0

  • Improves PnP compatibility with Node 6

    #6871 - Robert Jackson

  • Fixes PnP detection with workspaces (installConfig is now read at the top-level)

    #6878 - Maƫl Nison

  • Fixes an interaction between yarn pack and bundled dependencies

    #6908 - Travis Hoover

  • Adds support for GITHUB_TOKEN in yarn policies set-version

    #6912 - Billy Vong

  • Fixes an issue where resolve would forward an incomplete basedir to the PnP hook

    #6882 - Zoran Regvart

  • Fixes the command that yarn unlink recommends to run as a followup (now yarn install --force)

    #6931 - Justin Sacbibit

  • Changes the location where the --require ./.pnp.js flag gets added into NODE_OPTIONS: now at the front

    #6942 - John-David Dalton

  • Fixes a bug where os and platform requirements weren't properly checked when engines was missing

    #6976 - Micha Reiser

1.13.0

1.12.3

Important: This release contains a cache bump. It will cause the very first install following the upgrade to take slightly more time, especially if you don't use the Offline Mirror feature. After that everything will be back to normal.

  • Fixes an issue with yarn audit when using workspaces

    #6625 - Jeff Valore

  • Uses NODE_OPTIONS to instruct Node to load the PnP hook, instead of raw CLI arguments

    Caveat: This change might cause issues for PnP users having a space inside their cwd (cf nodejs/node#24065)

    #6479 - Maƫl Nison

  • Fixes Gulp when used with Plug'n'Play

    #6623 - Maƫl Nison

  • Fixes an issue with yarn audit when the root package was missing a name

    #6611 - Jack Zhao

  • Fixes an issue with yarn audit when a package was depending on an empty range

    #6611 - Jack Zhao

  • Fixes an issue with how symlinks are setup into the cache on Windows

    #6621 - Yoad Snapir

  • Upgrades inquirer, fixing upgrade-interactive for users using both Node 10 and Windows

    #6635 - Philipp Feigl

  • Exposes the path to the PnP file using require.resolve('pnpapi')

    #6643 - Maƫl Nison

1.12.2

This release doesn't actually exists and was caused by a quirk in our systems.

1.12.1

1.12.0

  • Adds initial support for PnP on Windows

    #6447 - John-David Dalton

  • Adds yarn audit (and the --audit flag for all installs)

    #6409 - Jeff Valore

  • Adds a special logic to PnP for ESLint compatibility (temporary, until eslint/eslint#10125 is fixed)

    #6449 - Maƫl Nison

  • Makes the PnP hook inject a process.versions.pnp variable when setup (equals to VERSIONS.std)

    #6464 - Maƫl Nison

  • Disables by default (configurable) the automatic migration of the integrity field. It will be re-enabled in 2.0.

    #6465 - Maƫl Nison

  • Fixes the display name of the faulty package when the NPM registry returns corrupted data

    #6455 - Grey Baker

  • Prevents crashes when running yarn outdated and the NPM registry forgets to return the latest tag

    #6454 - mad-mike

  • Fixes yarn run when used together with workspaces and PnP

    #6444 - Maƫl Nison

  • Fixes an edge case when peer dependencies were resolved multiple levels deep (webpack-dev-server)

    #6443 - Maƫl Nison