Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

berry

> 包管理
Open source

Active development trunk for Yarn ⚒

8.1K stars0 likes3 views
WebsiteGitHub

About

Active development trunk for Yarn ⚒

Fast, reliable, and secure dependency management.


Yarn is a modern package manager split into various packages. Its novel architecture allows to do things currently impossible with existing solutions:

  • Yarn supports plugins; adding a plugin is as simple as adding it into your repository
  • Yarn supports Node by default but isn't limited to it - plugins can add support for other languages
  • Yarn supports workspaces natively, and its CLI takes advantage of that
  • Yarn uses a bash-like portable shell to make package scripts portable across Windows, Linux, and macOS
  • Yarn is first and foremost a Node API that can be used programmatically (via @yarnpkg/core)
  • Yarn is written in TypeScript and is fully type-checked

Our supports

Gold sponsors

  </a>
  <a href="https://www.doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=yarn&utm_source=github#gh-dark-mode-only">
    
  </a>
</td>
<td>
  <b>All your environment variables, in one place</b>. Stop struggling with scattered API keys, hacking together home-brewed tools, and avoiding access controls. Keep your team and servers in sync with <b><a href="https://www.doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=yarn&utm_source=github">Doppler</a></b>.
</td>
  </a>
  <a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=berry&utm_source=github#gh-dark-mode-only">
    
  </a>
</td>
<td>
  <b>Your app, enterprise-ready</b>. Start selling to enterprise customers with just a few lines of code. Add Single Sign-On (and more) in minutes instead of months with <b><a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=berry&utm_source=github">WorkOS</a></b>.
</td>

But also

  </a>
</td>
<td>
  <b><a href="https://www.datadoghq.com/">Datadog</a></b> has been sponsoring the time of our lead maintainer for more than a year now. They also upgraded our account so that we can benefit from long-term telemetry (<a href="https://github.com/yarnpkg/berry/issues/1250">RFC</a>).
</td>
  </a>
</td>
<td>
  <b><a href="https://sysgears.com/">SysGears</a></b> also sponsored time from very early in the 2.x development. In particular, their strong investment is the reason why Yarn 2 supports node_modules installs even better than it used to.
</td>
  </a>
</td>
<td>
  <b><a href="https://www.netlify.com/">Netlify</a></b> has been the historical provider for our website. Each time we got issues, they jumped to our help. Their live previews have been super helpful in our development process.
</td>
  </a>
</td>
<td>
  <b><a href="https://www.cloudflare.com/">Cloudflare</a></b> has also been a historical partner. While we don't directly mirror the npm registry anymore, they still power our website to make its delivery as fast as possible.
</td>
  </a>
</td>
<td>
  <b><a href="https://www.algolia.com/">Algolia</a></b> contributed a lot to our documentation over the years. They still power the search engine we use on both versions of the documentation.
</td>

Installation

Consult the Installation Guide.

Migration

Consult the Migration Guide.

Documentation

The documentation can be found at yarnpkg.com.

API

The API documentation can be found at yarnpkg.com/api.

Current status

On top of our classic integration tests, we also run Yarn every day against the latest versions of the toolchains used by our community - just in case. Everything should be green!

Contributing

Consult the Contributing Guide.

Building your own bundle

Clone this repository, then run the following commands:

bash
yarn build:cli

How it works

After building the CLI your global yarn will immediately start to reflect your local changes. This is because Yarn will pick up the yarnPath settings in this repository's .yarnrc.yml, which is configured to use the newly built CLI if available.

Works out of the box!

Note that no other command is needed! Given that our dependencies are checked-in within the repository (within the .yarn/cache directory), you don't even need to run yarn install. Everything just works right after cloning the project and is guaranteed to continue to work ten years from now

Yarn plugins

Default plugins

Those plugins typically come bundled with Yarn. You don't need to do anything special to use them.

  • plugin-compat contains a few built-in patches applied to improve PnP support.
  • plugin-constraints adds support for constraints to Yarn.
  • plugin-dlx adds support for the yarn dlx command.
  • plugin-essentials adds various commands deemed necessary for a package manager (add, remove, ...).
  • plugin-exec adds support for using the exec: protocol within your dependencies.
  • plugin-file adds support for using the file: protocol within your dependencies.
  • plugin-git adds support for cloning packages from Git repositories.
  • plugin-github adds support for using GitHub references as dependencies. This plugin doesn't use git.
  • plugin-http adds support for using straight URL references as dependencies (tgz archives only).
  • plugin-init adds support for the yarn init command.
  • plugin-interactive-tools adds support for various interactive commands (yarn upgrade-interactive).
  • plugin-link adds support for using link: and portal: references as dependencies.
  • plugin-nm adds support for installing packages through a node_modules folder.
  • plugin-npm adds support for using semver ranges dependencies, resolving them from an npm-like registry.
  • plugin-npm-cli adds support for npm-specific commands (yarn npm login, yarn npm publish, ...).
  • plugin-pack adds support for the yarn pack command.
  • plugin-patch adds support for the patch: protocol.
  • plugin-pnp adds support for installing JavaScript dependencies through the Plug'n'Play specification.
  • plugin-stage adds support for the yarn stage command.
  • plugin-typescript improves the user experience when working with TypeScript.
  • plugin-version adds support for the new release workflow.
  • plugin-workspace-tools adds support for the yarn workspaces foreach command.

Third-party plugins

Plugins can be developed by third-party entities. To use them within your applications, just specify the full plugin URL when calling yarn plugin import. Note that plugins aren't fetched from the npm registry at this time - they must be distributed as a single JavaScript file.

Creating a new plugin

To create your own plugin, please refer to the documentation.

Generic packages

The following packages are generic and can be used for a variety of purposes (including to implement other package managers, but not only):

  • @yarnpkg/core allows any application to manipulate a

Issues· 991 open

View all issuesOpen on GitHub
  • #7101

    [Feature] Support trustPolicy to reject packages with provenance downgrade at install time

    enhancementhelp wantedUpdated Sep 30, 2026
  • #7281

    [Bug?]: installs fail on latest version due to relative path in `got` dependency

    bugUpdated Sep 30, 2026
  • #7194

    [Bug]: Windows - missing files at install on large packages

    bugUpdated Sep 29, 2026
  • #7289

    [Bug?]: `yarn upgrade-interactive` silently ignores errors when checking package versions

    bugUpdated Sep 29, 2026
  • #6957

    [Bug?]: Duplicate sidebar link for the yarn init command

    bugUpdated Sep 29, 2026
  • #7280

    [Feature] Allow opt-in`yarn workspaces focus` without pruning unneeded dependencies

    enhancementUpdated Sep 23, 2026
  • #7275

    # [Bug?]: `yarn version apply --prerelease=<id>` drops the prerelease identifier in 4.18.0

    bugUpdated Sep 22, 2026
  • #6031

    [Bug?]: Example to set a complex config does not work on Windows (Powershell / cmd)

    bugwaiting for feedbackUpdated Sep 21, 2026
  • #7192

    [Bug?]: Disabling global `npmMinimalAgeGate` does not disable scoped `npmMinimalAgeGate`

    bugUpdated Sep 18, 2026
  • #6804

    [Bug?]: Changes to files with special characters in the name cause false positives in `yarn workspaces list --since`

    bugUpdated Sep 14, 2026

> Tags

TypeScriptjavascriptnodejspackage-manageryarn

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category包管理
PricingOpen source

> Related tools

N
npm
Node.js 默认包管理器
P
pnpm
高效节省磁盘的 Node 包管理器
I
is-gif
Check if a Buffer/Uint8Array is a GIF image