Yarn Classic

Yarn Classic, the 1.x line.

mpm claims this class for any yarn binary reporting a 1.x version and drives it through the yarn global command family, so installs, upgrades and removals target the global prefix. Its --json output is a stream of one JSON object per line, not a single document, so every query is parsed line by line.

Warning

Yarn Classic has been in maintenance mode since January 2020, taking only critical and security patches. Yarn Berry (2.x and later) is the actively developed line but exposes a different CLI surface, so mpm handles it through a separate YarnBerry manager.

Note

Yarn has no dedicated search command by maintainer decision, so search is simulated with yarn info and only resolves exact package names.

Platforms

  • 🅱️ BSD

  • 🐧 Linux

  • 🍎 macOS

  • ⨂ Unix

  • 🪟 Windows

Operations

Operation

Supported

Notes

installed

outdated

search

exact and extended search backfilled by mpm

install

upgrade

upgrade_all

remove

sync

cleanup

Ecosystem

  • Accepted purl types: pkg:npm, pkg:yarn

Usage

$ mpm --yarn installed
$ mpm --yarn search "query"
$ mpm --yarn upgrade --all
$ mpm install pkg:yarn/hello
$ mpm --dry-run --yarn upgrade --all

Every example above accepts --dry-run, which simulates the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.

Deselect the manager for a single run with --no-yarn, disable it from your configuration, or tune its invocation attributes with per-manager overrides.

Command line

  • CLI names, in lookup order: yarn

  • Arguments forced before each call: --silent

The version is extracted from the output of yarn --version with:

r"(?P<version>\S+)"

Privilege escalation

mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.

See privilege escalation for the full policy.

Cooldown

State of Yarn Classic’s release-age gating, from the cooldown support table:

  • Status: ❌ None (project in maintenance mode)

  • Reference: yarnpkg/yarn

With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.

Reference traces

Raw native outputs captured in the manager source: the reference mpm’s parsers were written against. If you know Yarn Classic well and a transcript below looks wrong, or a newer release changed its output format, report it.

$ yarn global --json list --depth 0
{"type":"activityStart","data":{"id":0}}
{"type":"activityTick","data":{"id":0,"name":"awesome-lint@^0.18.0"}}
{"type":"activityTick","data":{"id":0,"name":"arrify@^2.0.1"}}
{"type":"activityTick","data":{"id":0,"name":"case@^1.6.3"}}
{"type":"activityTick","data":{"id":0,"name":"emoji-regex@^9.2.0"}}
{"type":"activityEnd","data":{"id":0}}
{"type":"progressStart","data":{"id":0,"total":327}}
{"type":"progressTick","data":{"id":0,"current":1}}
{"type":"progressTick","data":{"id":0,"current":2}}
{"type":"progressTick","data":{"id":0,"current":3}}
{"type":"progressTick","data":{"id":0,"current":4}}
{"type":"progressTick","data":{"id":0,"current":5}}
{"type":"progressFinish","data":{"id":0}}
{"type":"info","data":""awesome-lint@0.18.0" has binaries:"}
{"type":"list","data":{"type":"bins-awesome-lint","items":["awesome-lint"]}}
$ yarn --json outdated --cwd ~/.config/yarn/global
{"type":"warning","data":"package.json: No license field"}
{"type":"table","data":{"head":["Package","Current","Wanted","Latest","Package Type","URL"],"body":[["markdown","0.4.0","0.4.0","0.5.0","dependencies","git://github.com/evilstreak/markdown-js.git"]]}}