@yarnpkg/parsers
3.1.0 · 29 Jul 2026BSD-2-Clause6.2M / weekRepositorynpmAtom feed
3.1.0 is the newest release of 3.x.
In short
13 breaking1 removed3 new12 fixed40 changed1 internal
- 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
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.
Release note
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.
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.