@yarnpkg/shell
4.1.4 · 21 Nov 2026BSD-2-Clause1.2M / weekRepositorynpmAtom feed
22 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 4.x · latest line
4.1.0
14 Sep 2024Tweaks
-,--verboseinyarn workspaces foreach;-vwill now only print the prefixes,-vvwill be necessary to also print the timings.Adds a new
--jsonoption toyarn runwhen called without script nameFixes
node-moduleslinkerlink:dependencies mistreatment as inner workspaces, when they point to a parent folder of a workspace
Tweaks
-,--verboseinyarn workspaces foreach;-vwill now only print the prefixes,-vvwill be necessary to also print the timings.Adds a new
--jsonoption toyarn runwhen called without script nameFixes
node-moduleslinkerlink:dependencies mistreatment as inner workspaces, when they point to a parent folder of a workspaceFixes spurious "No candidates found" errors
Fixes missing executable permissions when using
nodeLinker: pnpmFixes packages being incorrectly flagged as optional
Fixes cache key corruptions due to uncontrolled git merges
Fixes
yarn version apply --all --dry-runmaking unexpected changesFixes
yarn npm loginwhen the remote registry is Verdaccio
4.0.2
2 May 20244.0.1
2 May 2024Fixes creation of symlinks for
node-moduleslinker when inner workspace depends on outer workspaceFixes progress bars when the terminal is too large
Fixes crashes while running Yarn within Docker within GitHub Actions
Fixes creation of symlinks for
node-moduleslinker when inner workspace depends on outer workspaceFixes progress bars when the terminal is too large
Fixes crashes while running Yarn within Docker within GitHub Actions
Fixes
yarn npm audit --ignore NUMwhich didn't apply to deprecationsFixes
yarn npm audit --jsonwhich didn't print the right output formatFixes an incorrect type export in
@yarnpkg/coreImplements back the
yarn explain peer-requirementscommand
4.0.0
22 Oct 2023- Breaking
With Node.js 16's now being End of Life'd, we dropped support for Node.js versions lower than 18.12.
- Breaking
Some important defaults have changed:
- Breaking
All official Yarn plugins are now included by default in the bundle we provide. You no longer need to run
yarn plugin importfor official plugins (you still need to do it for third-party plugins, of course).
Major Changes
- Breaking
With Node.js 16's now being End of Life'd, we dropped support for Node.js versions lower than 18.12.
- Breaking
Some important defaults have changed:
yarn initandyarn set versionwill prefer usingpackageManagerrather thanyarnPathwhen possible (when they detectCOREPACK_ROOTin your environment variables).yarn initwill no longer use zero-install by default. You still can enable it, but it should make it easier to start one-of projects without having to rewrite the configuration afterwards.As a result,
enableGlobalCachenow defaults totrue. If your project uses Zero-Installs, the firstyarn installyou run after migrating to 4.0 will automatically setenableGlobalCache: falsein your local.yarnrc.yml.
yarn workspaces foreachnow requires one of--all,--recursive,--since, or--worktreeto be explicitly specified; the previous default was--worktree, but it was rarely what users expected.compressionLevelnow defaults to0rather thanmixed. It's been proved significantly faster on installs, and the size impact was reasonable enough to change the default. Note that it benefits you even if you use Zero-Installs: as per our tests, a zero-compression is actually easier to handle for Git (you can see by yourself with those examples usingcompressionLevel: 0vscompressionLevel: mixed).To avoid making the upgrade too disruptive, Yarn will check whether Zero-Installs are enabled the first time you run
yarn installafter migrating from 3.6 to 4.0. If you do, it will automatically set the old default (compressionLevel: mixed) in your.yarnrc.ymlfile. You can then remove it whenever you feel ready to actually change the compression settings.
- Breaking
All official Yarn plugins are now included by default in the bundle we provide. You no longer need to run
yarn plugin importfor official plugins (you still need to do it for third-party plugins, of course).This doesn't change anything to the plugin API we provide, which will keep being maintained.
Yarn still has a modular architecture and uses the exact same APIs as contrib plugins; all that changes is how we distribute our own features.
- Breaking
Yarn's UI during installs has been greatly improved:
Packages added and removed from the lockfile are now explicitly reported.
Fluctuations in the project cache size are now reported as a single line.
Unactionable warnings (
node-gypand transitive peer dependency errors) have been removed.Skipped builds are now only reported during initial installs and manual
yarn rebuildcalls.The Yarn version is now displayed on installs to help us investigate issues when reported as screenshots.
Deprecation checks have been moved to
yarn npm audit.
- Breaking
Some settings were renamed or removed:
caFilePathis nowhttpsCaFilePathpreferAggregateCacheInfohas been removed (it's now always on)pnpDataPathhas been removed to adhere to our new PnP specification. For consistency, all PnP files will now be hardcoded to a single value so that third-party tools can implement the PnP specification without relying on the Yarn configuration.
- Breaking
The
yarn npm auditcommand has been reimplemented:The audit registry must now implement the
/-/npm/v1/security/advisories/bulkendpoint.The
npmAuditRegistrycan be used to temporarily route audit queries to the npm registry.Deprecations are now returned by default. To silence them, use
yarn npm audit ! --no-deprecations.
- Breaking
Some legacy layers have been sunset:
Plugins cannot access the Clipanion 2 APIs anymore (upgrade to Clipanion 3)
Plugins cannot access the internal copy of Yup anymore (use Typanion instead)
Yarn will no longer remove the old Yarn 2.x
.pnp.jsfile when migrating.The
--assume-fresh-projectflag ofyarn inithas been removed.
API Changes
The following changes only affect people writing Yarn plugins:
The
ZipFSandZipOpenFSclasses have been moved from@yarnpkg/fslibto@yarnpkg/libzip. They no longer need or accept thelibzipparameter.Reading the zip archives is now done on the Node.js side for performance; as a result, the
open,ZIP_CREATE, andZIP_TRUNCATEbindings are no longer needed forZipFSand have also been removed.
The
dependenciesfield sent returned byResolver#resolvemust now be the result of aConfiguration#normalizeDependencyMapcall. This change is prompted by a refactoring of how default protocols (ienpm:) are injected into descriptors. The previous implementation caused various descriptors to never be normalized, which made it difficult to know what were the descriptors each function should expect.Similarly, the descriptors returned by
Resolve#getResolutionDependenciesare now expected to be the result ofConfiguration#normalizeDependencycalls.Note that this only applies to the
dependenciesfield; thepeerDependenciesfield is unchanged, as it must only contains semver ranges without any protocol (with an exception forworkspace:, but that's not relevant here).
The
Resolve#getResolutionDependenciesfunction must now return an object of arbitrary string keys and descriptor values (instead of a map withDescriptorHashkeys). Those descriptors will be resolved and assigned to the same keys as the initial object. This change allows resolvers to wrap resolution dependencies from other resolvers, which wasn't possible before since it'd have caused the key to change.The
generateLoaderfunction in@yarnpkg/pnpno longer generates the$$SETUP_STATEfunction, it now needs to be present in theloaderpassed to the function.The
getCustomDataKeyfunction inInstallerfrom@yarnpkg/corehas been moved toLinker.renderForm'soptionsargument is now required to enforce that custom streams are always specified.npmConfigUtils.getAuditRegistryno longer takes aManifestas its first argument.The
FetchOptions.skipIntegrityCheckoption has been removed. UseFetchOptions.cacheOptions.skipIntegrityCheckinstead.- Removed
MapConfigurationValuehas been removed. UsemiscUtils.ToMapValueinstead. Manifest.isManifestFieldCompatibleandManifest.prototype.isCompatibleWith{OS,CPU}have been removed. UseManifest.prototype.getConditionsandstructUtils.isPackageCompatibleinstead.versionUtils.{fetchBase,fetchRoot,fetchChangedFiles}have been moved from@yarnpkg/plugin-versionto@yarnpkg/plugin-git. UsegitUtils.{fetchBase,fetchRoot,fetchChangedFiles}instead.For consistency reasons:
Link{Resolver,Fetcher}have been renamed toPortal{Resolver,Fetcher}RawLink{Resolver,Fetcher}have been renamed toLink{Resolver,Fetcher}
FakeFSclasses are now required to implementlutimes{Sync,Promise}.- Removed
workspace.dependencieshas been removed. Useworkspace.anchoredPackage.dependenciesinstead. The
Installerclass must now returnBuildRequeststructures instead ofBuildDirective. This lets you mark that the build must be skipped, and the reason why.- Removed
startCacheReporthas been removed, and is now part of the output generated byfetchEverything. forgettableNames&forgettableBufferSizehave been removed (the only messages using them have been removed, making the forgettable logs implementation obsolete).- Removed
workspace.locatorhas been removed. You can instead use:workspace.anchoredLocatorto get the locator that's used throughout the dependency tree.workspace.manifest.versionto get the workspace version.
- Removed
configuration.{packageExtensions,refreshPackageExtensions}have been removed. Useconfiguration.getPackageExtensionsinstead. configuration.normalizePackagenow requires apackageExtensionsoption.- Removed
ProjectLookuphas been removed. BothConfiguration.findandConfiguration.findProjectCwdnow always do a lockfile lookup.
Installs
Yarn now caches npm version metadata, leading to faster resolution steps and decreased network data usage.
The
pnpmlinker avoids creating symlinks that lead to loops on the file system, by moving them higher up in the directory structure.The
pnpmlinker no longer reports duplicate "incompatible virtual" warnings.
Features
enableOfflineModeis a new setting that, when set, will instruct Yarn to only use the metadata and archives already stored on the local machine rather than download them from the registry. This can be useful when performing local development under network-constrained environments (trains, planes, ...).yarn run binnow injects the environment variables defined in.env.yarnwhen spawning a process. This can be configured using theinjectEnvironmentFilesvariable.yarn workspaces foreachnow automatically enables theyarn workspaces foreach ! --verboseflag in interactive terminals.Constraints can now be written in JavaScript. See the revamped documentation for more information.
Bugfixes
yarn dlxwill no longer report false-positiveUNUSED_PACKAGE_EXTENSIONwarningsyarn workspacewill now set$INIT_CWDto the CLI working directory rather than the workspace root.
Shell
The builtin shell now supports whitespace-only commands.
Compatibility
The patched filesystem now supports
FileHandle.readLines.PnP now reports missing files when in watch mode.
- 3.x
3.3.0
14 Nov 2023The node-modules linker avoids creation of circular symlinks
The node-modules linker no longer creates duplicate copies inside of aliased packages
The node-modules linker locates binaries correctly when the same version of the package is duplicated inside root workspace and another workspace
Installs
The node-modules linker avoids creation of circular symlinks
The node-modules linker no longer creates duplicate copies inside of aliased packages
The node-modules linker locates binaries correctly when the same version of the package is duplicated inside root workspace and another workspace
Improved performance for
hardlinks-globalnode-moduleslinker mode by 1.5x
Compatibility
Updates the PnP compatibility layer for TypeScript v4.9.2-rc.
3.2.5
16 Nov 20223.2.4
24 Aug 2022The patched filesystem now supports fchown.
PnP now handles private import mappings.
Updates the PnP compatibility layer for TypeScript v4.8.4 and v4.9.1-beta.
Compatibility
The patched filesystem now supports fchown.
PnP now handles private import mappings.
Updates the PnP compatibility layer for TypeScript v4.8.4 and v4.9.1-beta.
PnP now reports loaded modules when in watch mode.
3.2.3
21 Jul 2022When Corepack is enabled Yarn will now use the current CLI to prepare external Yarn classic projects, matching the behaviour of when Corepack is disabled.
Updates the PnP compatibility layer for TypeScript 4.8.1-rc
The ESM loader now supports unflagged JSON modules.
3.2.2
13 May 2022The patched filesystem now supports
ftruncate.The patched filesystem now supports
fchmod.The patched filesystem now supports
throwIfNoEntry.
Compatibility
The patched filesystem now supports
ftruncate.The patched filesystem now supports
fchmod.The patched filesystem now supports
throwIfNoEntry.The PnP filesystem now handles most of the FileHandle methods
Updates the PnP compatibility layer for TypeScript 4.8 Beta
The
npm_package_jsonenvironment variable is now set by Yarn.
3.2.1
13 May 2022The pnpm linker no longer tries to remove
node_modulesdirectory, whennode-moduleslinker is activeThe node-modules linker does not fail anymore if portal dependency points to an external project with multiple interdependent workspaces
The node-modules linker has received various improvements:
Installs
The pnpm linker no longer tries to remove
node_modulesdirectory, whennode-moduleslinker is activeThe node-modules linker does not fail anymore if portal dependency points to an external project with multiple interdependent workspaces
The node-modules linker has received various improvements:
applies hoisting algorithm on aliased dependencies
reinstalls modules that have their directories removed from node_modules by the user
improves portal hoisting
supports
supportedArchitectures
Bugfixes
The PnP ESM loader is now able to handle symlinked extensionless entrypoints.
3.2.0
21 Feb 2022The
yarn workspaces foreach runcommand is now able to run binaries.The
yarn npm infocommand now supports displaying information about a tagged version of a package (e.g.yarn npm info vue@next).A new
yarn explaincommand has been added. It can be used to explain an error code, or list all available error codes.
Various improvements have been made in the core to improve performance. Additionally:
Commands
The
yarn workspaces foreach runcommand is now able to run binaries.The
yarn npm infocommand now supports displaying information about a tagged version of a package (e.g.yarn npm info vue@next).A new
yarn explaincommand has been added. It can be used to explain an error code, or list all available error codes.For example, try to run
yarn explain YN0002.
The
yarn npm publishcommand now accepts a new--otpoption, to set the One-Time Password from the CLI.A better error message will also be shown when a query fails due to an invalid OTP.
yarn upgrade-interactivenow has improved paging:Yarn will display as many suggestions as can fit in the viewport (rather than a fixed-size list).
The suggestions that fit in the viewport will be fetched in the foreground and will load one-by-one.
The suggestions that don't will be fetched in the background and will be loaded in batches to increase responsiveness and reduce input lag.
Most notably, you won't have to wait for all of the suggestions to be fetched (which took a very long time before on large monorepos) before you can start navigating through the list.
Installs
The node-modules linker now tolerates if
node_modulesis a symbolic link, and doesn't recreate it.On top of the
cpuandarchfields, Yarn now support a newlibcfield which can be used in tandem withoptionalDependenciesto avoid downloading packages that have been linked against incompatible standard libraries (we currently support two values:glibcandmusl).The pnpm linker has received various improvements:
It will now remove the
node_modules/.storeandnode_modulesfolders if they are empty.It now supports running binaries of soft links.
It will now create self-references for packages that don't depend on other versions of themselves.
It will now remove scope folders (e.g.
node_modules/@yarnpkg) if they are empty or after removing a scoped dependency.
All
.pnp.cjsfiles with inlined data will now store the data in a JSON string literal instead of an object literal to improve startup performance.
Compatibility
The shell now treats backslashes same as Bash (so it mostly ignore them).
Could potentially be a breaking change, but the old behavior caused portability issues with a few packages, so we had to make this change (especially since the portable shell is intended to help portability).
The shell now supports
${FOO:+}.The PnP filesystem now handles
readandreadSyncusing options.The PnP filesystem now handles UNC paths using forward slashes.
The PnP filesystem now sets the proper
pathproperty on streams created bycreateReadStream()and obtained from zip archives.The PnP runtime now throws an
ERR_REQUIRE_ESMerror when attempting to require an ES Module, matching the default Node.js behaviour.Updates the PnP compatibility layer for TypeScript 4.6 Beta (it's possible we'll need to publish another patch update once the 4.6 enters stable).
Bugfixes
@yarnpkg/pnpifynow escapes paths correctly.The ESM loader is now enabled regardless of the entrypoint module type, this fixes support for dynamic imports in commonjs modules when the entrypoint is also commonjs.
The ESM loader is now able to resolve relative imports with search parameters.
The
nodefield inside thenpm_config_user_agentYarn sets will now include a leadingv.Yarn is now able to recover from a corrupted install state.
Yarn is now able to migrate classic lockfiles containing unconventional tarball URLs.
The nm linker hoists portals after hoisting their dependencies first.
Fixed a crash caused by a bad interaction between aliased packages and peer dependencies.
The ESBuild plugin will no longer allow access to Node.js builtins if the
platformisn't set to Node.SemVer ranges with build metadata can now be resolved.
The
YARN_IGNORE_NODEenvironment variable will now be parsed using the same mechanism as env variable configuration settings (i.e. both1/0andtrue/falsewill be accepted)
ZipFS Extension
You can now unmount zip folders by right-clicking on their workspaces.
Miscellaneous Features
Reporting for Git errors has been improved.
The resolution step now has a progress indicator.
The experimental ESM loader warning emitted by Node.js is now suppressed.
Private registries can now be authenticated using private keys and certificates.
A new
wrapNetworkRequesthook now lets you wrap network requests (for example to log them).
3.1.0
25 Oct 2021The
yarn workspaces listandyarn workspaces foreachcommands now both support a new--sinceoption that lets you filter the workspace list by changes (only workspaces that changed since the specified commit will be iterated on). This feature is still a little experimental, especially when used with-R,--recursive.The
yarn workspaces foreachcommand now handles the fact that a script containing:only becomes global if it exists in exactly one workspace.The
yarn workspaces foreachcommand now supports--jobs 1and--jobs unlimited.
Commands
The
yarn workspaces listandyarn workspaces foreachcommands now both support a new--sinceoption that lets you filter the workspace list by changes (only workspaces that changed since the specified commit will be iterated on). This feature is still a little experimental, especially when used with-R,--recursive.The
yarn workspaces foreachcommand now handles the fact that a script containing:only becomes global if it exists in exactly one workspace.The
yarn workspaces foreachcommand now supports--jobs 1and--jobs unlimited.The
yarn init -2command will now add thepackageManagerfield to your project manifest.
Settings
The
patternmatcher fromlogFilterswill now match any part of the log entry.
Installs
A new
nodeLinker: pnpmmode will let you install packages using the pnpm install strategy, where packages are stored flat and referenced by each others through symlinks. This mode is still a little experimental, so please send our way bugs you might find.Yarn won't install anymore packages that don't match the current OS. Should you need to (for example if you check-in your cache), use the
supportedArchitecturesfield to manually enforce the presence of specific architectures.The
nmMode: hardlinks-globalsetting will now be automatically downgraded tonmMode: hardlinks-localwhen global caches and install folders are kept on different devices, thus letting the install continue normally. A warning will still be produced explaining this behaviour.The
node_moduleslinker maximizes chances to end-up with only one top-level node_modules in the case of using workspacesThe
nmSelfReferencessetting has been added to the nm linker to control whether workspaces are allowed to require themselves - results in creation of self-referencing symlinks.yarn workspaces focuswill not create self-referencing symlinks for excluded workspaces anymore.Yarn can now install workspaces from remote git repositories that use npm if npm@>=7.x is installed on the system.
The hoisting algorithm should be faster, improving the install time for recurrent
node_modulesinstalls.
Miscellaneous Features
Workspaces can now be referred to using
workspace:^andworkspace:~. When published, those markers will turn into the actual version (just like what used to happen withworkspace:*), except that they'll be prefixed with the relevant semver prefix (respectively^and~).A new
npmAuditRegistrysetting will let you define which registry to use when running audits. If unset, we'll fallback to the currently configured publish registry (we'll likely change this behavior in Yarn 4 to rather use the fetch registry).
Bugfixes
Direct portal dependencies for
node_modulesinstalls will now be given priority during hoisting, preventing cases when indirect regular dependencies would block the way for direct portal dependencies.The
pnpifybinary can now be used from inside directories containing spaces.The CLI bundles built from sources will now output the commit hash instead of the tree hash, as part of their
--versionstring.Nested workspaces are properly hoisted by
node-moduleslinker.Self-referencing symlinks won't be created for anonymous workspaces when using the
node-moduleslinker, since they cannot be used from the code anyway.The cache is now fully atomic when moving files across devices, and is more efficient in general.
The PnP patch will now properly pick up changes to the
fsmodule, allowing users to patch it.When using PnP,
require.resolve('pnpapi')will be handled correctly even when usingexports.The install state will no longer be invalidated after running commands that modify the lockfile; this should bring a significant performance improvement when running commands such as
yarn runimmediately after adding or removing dependencies inside large monorepos.Optional peer dependencies now imply an optional peer dependency on the corresponding
@typesversion. This matches the behaviour for peer dependencies.
Compatibility
Yarn will now generate an experimental ESM loader when it detects you may need it. This can be disabled (or enabled) using
pnpEnableEsmLoader.The PnP compatibility patch for
resolvewill no longer resolve missing modules to a file with the same name that would happen to be located next to the issuer.Fixes the SDK to account for a breaking change in VSCode >=1.61.
3.0.0
26 Jul 2021- Breaking
Node 10 isn't supported anymore.
- Breaking
Plugins can't access
yupanymore (we migrated to Typanion as part of Clipanion v3). - Breaking
The
enableImmutableInstallswill now default totrueon CI (we still recommend to explicitly use--immutableon the CLI).
Breaking Changes
- Breaking
Node 10 isn't supported anymore.
- Breaking
Plugins can't access
yupanymore (we migrated to Typanion as part of Clipanion v3).To upgrade
workspace-tools, remove it from your.yarnrc.yml, upgrade, then import it back.
- Breaking
The
enableImmutableInstallswill now default totrueon CI (we still recommend to explicitly use--immutableon the CLI).You can re-allow mutations by adding
YARN_ENABLE_IMMUTABLE_INSTALLS=falsein your environment variables.
- Breaking
The
initVersionandinitLicenseconfiguration options have been removed.initFieldsshould be used instead. - Breaking
Yarn will now generate
.pnp.cjsfiles (instead of.pnp.js) when using PnP, regardless of what thetypefield inside the manifest is set to. - Breaking
The virtual folder (used to disambiguate peer dependencies) got renamed from
$$virtualinto__virtual__. - Breaking
The
-aalias flag ofyarn workspaces foreachgot removed; use-A,--allinstead, which is strictly the same. - Breaking
The old PnPify SDK folder (
.vscode/pnpify) won't be cleaned up anymore. - Breaking
The
--skip-buildsflag fromyarn installgot renamed into--mode=skip-build. - Breaking
The
bstatePathconfiguration option has been removed. The build state (.yarn/build-state.yml) has been moved into the install state (.yarn/install-state.gz) - Breaking
The cache files need to be regenerated. We had to change their timestamps in order to account for a flaw in the zip spec that was causing problems with some third-party tools.
- Breaking
@yarnpkg/pnpifyhas been refactored into 3 packages:@yarnpkg/sdksnow contains the Editor SDKs@yarnpkg/pnpifynow contains the PnPify CLI compatibility tool that creates in-memorynode_modules@yarnpkg/nmnow contains thenode_modulestree builder and hoister
- Breaking
@yarnpkg/plugin-node-moduleshas been renamed to@yarnpkg/plugin-nm - Breaking
The
--clipanion=definitionscommands supported by our CLIs will now expose the definitions on the entry point (rather than on.command)
API
structUtils.requirableIdentgot removed; usestructUtils.stringifyIdentinstead, which is strictly the same.configuration.formatgot removed; useformatUtils.prettyinstead, which is strictly the same, but type-safe.httpUtils.Options['json']got removed; usehttpUtils.Options['jsonResponse']instead, which is strictly the same.PackageExtension['description']got removed, useformatUtils.json(packageExtension, formatUtils.Type.PACKAGE_EXTENSION)instead, which is strictly the same.- Removed
Project.generateBuildStateFilehas been removed, the build state is now inProject.storedBuildState. Project.tryWorkspaceByDescriptorandProject.getWorkspaceByDescriptornow match on virtual descriptors.
Installs
Workspaces now get self-references even when under the
node-moduleslinker (just like how it already worked with thepnplinker). This means that a workspace calledfoocan now safely assume that calls torequire('foo/package.json')will always work, removing the need for absolute aliases in the majority of cases.The node-modules linker now does its best to support the
portal:protocol. This support comes with two important limitations:Projects that make use of such dependencies will have to be run with the
--preserve-symlinksNode option if they wish to access their dependencies.Because Yarn installs will never modify files outside of the project due to security reasons, sub-dependencies of packages with
portal:must be hoisted outside of the portal. Failing that (for example if the portal package depends on something incompatible with the version hoisted via another package), the linker will produce an error and abandon the install.
The node-modules linker can now utilize hardlinks. The new setting
nmMode: classic | hardlinks-local | hardlinks-globalspecifies whichnode_modulesstrategy should be used:classic- standardnode_moduleslayout, without hardlinkshardlinks-local- standardnode_moduleslayout with hardlinks inside the project onlyhardlinks-global- standardnode_moduleslayout with hardlinks pointing to global content storage across all the projects using this option
Bugfixes
Yarn now has a proper governance model.
The
node-moduleslinker will now ensure that the generated install layouts are terminal, by doing several rounds when needed.The
node-moduleslinker will no longer print warnings about postinstall scripts when a workspace depends on another workspace listing install scripts.Peer dependencies depending on their own parent are now properly hoisted by the node-modules linker.
Boolean values will be properly interpreted when specified inside the configuration file via the
${ENV_VAR}syntax.Should any of
preinstall,install,postinstallfail, the remaining scripts will be skipped.The
git:protocol will now default to fetchingHEAD(rather than the hardcodedmaster).The
SIGTERMsignal will now be propagated to child processes.The PnP linker now schedules packages to be rebuilt if their unplugged folder is removed
yarn config unsetwill now correctly unset non-nested propertiesThe TypeScript SDK now
And a bunch of smaller fixes.
Settings
Various
initFieldsedge cases have been fixed.The
preferAggregateCacheInfoflag will now also aggregate cleanup reports.A new
enableMessageNamesflag can be set tofalseto exclude theYNxxxxfrom the output.
Commands
yarn initcan now be run even from within existing projects (will create missing files).yarn initandyarn set versionwill set thepackageManagerfield.yarn set versionnow downloads binaries from the official Yarn website (rather than GitHub).yarn set version from sourceswill now upgrade the builtin plugins as well unless--skip-pluginsis set.yarn version applynow supports a new--prereleaseflag which replaces how prereleases were previously handled.yarn runshould be significantly faster to boot on large projects.yarn workspaces foreach --verbosewill now print when processes start and end, even if they don't have an output.yarn workspaces foreachnow supports a--from <glob>flag, which when combined with-Rwill target workspaces reachable from the 'from' glob.yarn patch-commitcan now be used as many times as you want on the same patch folder.yarn patch-commitnow supports a new-s,--saveflag which will save the patch instead of just printing it.yarn upnow supports a new-R,--recursiveflag which will upgrade the specified package, regardless where it is.yarn config unsetis a new command that will remove a setting from the local configuration (or home if-His set).yarn execgot support for running shell scripts using Yarn's portable shell.yarn plugin importcan now install specific versions of the official plugins.yarn plugin importwill now download plugins compatible with the current CLI by default.yarn unlinkhas been added which removes resolutions previously set byyarn link.
Builtin Shell
The shell now supports background jobs, with color-coded output.
It now also supports redirections from file descriptors.
Compatibility
Running
yarn installinside a Yarn v1 project will now automatically enable thenode-moduleslinker. This should solve most of the problems people have had in their migrations. We still recommend to keep the default PnP for new projects, but the choice is yours.The patched filesystem now supports file URLs,
bigint, andfstat.An official ESBuild resolver is now provided under the name
@yarnpkg/esbuild-plugin-pnp. We use it to bundle Yarn itself!PnP projects can now use the Node
exportsfield - regardless of the Node version.The PnP hook now supports the
node:protocol (new in Node 16)The Prettier SDK does not use PnPify anymore since it was its only remaining use, and was fairly invasive; as a result, the Prettier plugins must be specified in Prettier's
pluginsconfiguration property.Zip terminal links can now be clicked from within VSCode
Builtin patches that fail to apply will no longer cause an error (they'll emit a warning and the original sources will be used instead).
Remember that patches are a problem for our team too, and that we only do this because we don't have any other option available to us right now - if you wish to help, consider upvoting the relevant pull request in the TypeScript repository or, if you work at Microsoft, perhaps mention to your TypeScript team next door that fixing this would benefit you.
- 2.x
2.4.1
30 Nov 2020The release of TypeScript 4.2 couldn't be installed due to patch conflicts. This is now fixed. This version only includes a fix specific to 4.2, but future Yarn releases starting from 3.0 will be more tolerant of this kind of situation and won't cause such errors.
2.4.0
7 Oct 2020The resolution pipeline got reimplemented. We previously used a multi-pass approach where we performed SAT optimization between each pass, but after investigating it turned out the SAT optims had little impact and added performance bottlenecks. We now run the resolution using a much simpler and more efficient algorithm.
Linkers can now define custom data to cache between Yarn invocations. The builtin linkers new use those new capabilities to cache package information that can't change between runs. In practice, this translates into much faster recurrent installs (when running an install that adds few new packages, if any).
Warnings are now reported when
packageExtensionsrules are either unused or redundant with the original package definition.
yarn set version 2.4.0
Installs
The resolution pipeline got reimplemented. We previously used a multi-pass approach where we performed SAT optimization between each pass, but after investigating it turned out the SAT optims had little impact and added performance bottlenecks. We now run the resolution using a much simpler and more efficient algorithm.
Linkers can now define custom data to cache between Yarn invocations. The builtin linkers new use those new capabilities to cache package information that can't change between runs. In practice, this translates into much faster recurrent installs (when running an install that adds few new packages, if any).
Warnings are now reported when
packageExtensionsrules are either unused or redundant with the original package definition.Potentially breaking, but it was intended this way from the start: the
packageExtensionsfield cannot be used to replace dependencies anymore (only to add missing ones). Prefer using theresolutionsfield to replace existing ones.Progress bars are rendered less often, which should help performances on some terminals.
Aliased packages no longer include themselves in node_modules installs
CLI
The
upgrade-interactivecommand will now only show upgrade suggestions for packages that have available upgrades (rather than all of them).The
upgrade-interactivecommand has received UI improvements that should make it easier to look at.The
yarn workspaces focuscommand will now only run thepostinstallscripts for the focused workspaces.A new
yarn npm auditcommand lets you query audit information from the npm registry.The
yarn workspaces foreachcommand has a new flag,-R,--recursive, which will run a command on the current workspace and all others it depends on.A new
--skip-buildsoption onyarn installwill let you skip the build scripts without impacting the generated Yarn artifacts (contrary toenableScripts, which would also stop unplugging the packages that would otherwise be unplugged due to containing build scripts).
Binaries
It's now possible to run dependency binaries when using the node-modules linker even if one of your other dependencies is reported as incompatible with your system.
By default Windows automatically requests for administrator rights before spawning any binary whose filename contains "install", "setup", "update", or "patch" (it thinks they are installers). We now explicitly opt-out of this behavior in the binary jumpers we use on Windows.
By default, arguments passed to MinGW-compiled programs are automatically expanded by a basic glob pattern engine. We now explicitly opt-out of this behavior in the binary jumpers we use on Windows.
The Windows binary jumpers will now report the right exit code.
Settings
Using empty fallbacks in Yarnrc environment variables (
${VAR:-}) will now work.You can now use the new
logFilterssetting to turn warnings into either errors or info, or to hide them entirely. Note that we plan to significantly improve the peer dependency warnings in the next release, so perhaps don't silence them just now even if you have a bunch of them.
Shell
Some shell errors (
No matches found,Bad file descriptor,Unbound variable,Unbound argument) will now be recoverable errors that make the shell continue on to the next command in the chain instead of hard crashes. Fixes cases such asrm -rf ./inexistentFolder/* || true.
VSCode ZipFS Extension
The extension will now activate even if the workspace doesn't contain zip files (usually because you excluded them).
Compatibility
Some patches went missing for TypeScript <4. This is now fixed.
Calling
fs.exists(undefined)won't crash anymore.TypeScript import suggestions should now be correct even when the imported module is deep within a workspace.
TypeScript in watch mode (both using
-wand within VSCode) will now detect new dependencies as you add them.Some particular multi-dependency-trees setups will be better supported on Plug'n'Play installs.
Using
ctrl+clickon imports in VSCode won't take you to virtual packages anymore (require an SDK update).
2.3.0
2 Oct 2020The
yarn tagset of commands has been ported over from Yarn Classic asyarn npm tag.Running
yarn infowill now print many information about your dependencies. Various options are available to tweak the output, including--json. Plugin authors can provide their own information sections via thefetchPackageInfohook.Running
yarn stagewith the-r,--resetflag will now unstage all changes that seem related to Yarn.
yarn set version 2.3.0
CLI
The
yarn tagset of commands has been ported over from Yarn Classic asyarn npm tag.Running
yarn infowill now print many information about your dependencies. Various options are available to tweak the output, including--json. Plugin authors can provide their own information sections via thefetchPackageInfohook.Running
yarn stagewith the-r,--resetflag will now unstage all changes that seem related to Yarn.All commands now document each of their options (run
yarn add -hto see an example).Publish registry errors will now be reported as is rather than being collapsed into a generic error message.
A native binary jumper will now be used on Windows to avoid the
Terminate batch job (Y/N)?prompts when invoking dependency binaries.
PnP API
The following changes only apply to the
pnplinker (which is the default install strategy):The
pnpapimodule now exposes a new function calledgetAllLocatorsallow you to access the list of all locators in the map without having to traverse the dependency tree. This method is considered a Yarn extension, so you should check for its existence if you plan to use it in your code.When using a portal to a package that had peer dependencies, Yarn would loose the information required to resolve those peer dependencies. It will now properly resolve them the same way as all other packages in the dependency tree.
The following changes only apply to the
node-moduleslinker:The bin symlinks will now be properly removed from the
node_modules/.binfolder as their corresponding dependencies are removed.A new setting called
nmHoistingLimitshas appeared. It replaces what was previously known asnohoistin Yarn 1.We are now more forgiving for packages that make incorrect assumptions about the hoisting layout by first trying to maximize package exposure at the top-level. Only after the top-level has been populated will we deduplicate the remaining packages.
Fixed some pathological cases around peer dependencies. In particular, workspaces' peer dependencies will now be resolved against their closest workspace ancestor (according to the directory hierarchy) rather than be ignored. Note that peer dependencies are inherently problematic with workspaces when using the
node-moduleslinker, and that the strictly correct behavior can only be obtained by using the default Plug'n'Play linker.Running install after an interrupted install is supported now and will result in a consistent install state
Shell
Added support for
$$and$PPIDFixes some pathological globbing problems.
Bugfixes
The
yarn constraints --fixcommand will now properly persist the changes on disk.The
yarn unplugcommand will now work when used on packages with peer dependencies.The
yarn stagecommand will now allow to stage files when called without the-c,--commitflag.Fixes a performance regression when using FSEvents.
Third-party integrations
Updated the VSCode SDK to take into account changes in the TypeScript server protocol.
Added a few builtin extensions to improve compatibility with packages that weren't correctly listing their dependencies.
Updated the TypeScript patch to cover TypeScript 4.1.
2.2.0
28 Aug 2020Reading the note…
2.1.0
9 Jul 2020Reading the note…
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.