Yarn
$ yarn Official Med RiskPopular JavaScript/TypeScript package manager spanning Yarn Classic (v1) and Yarn Berry (v2–v4) with Plug'n'Play and workspace constraints. Supports --json inspection and --immutable/--frozen-lockfile CI safety, though v1 and Berry differ substantially in CLI flags.
brew install yarn Local JS/TS workspace and yarn.lock manager tightly integrated with project repos via Corepack.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --json (NDJSON) and YARN_ENABLE_COLORS=0 / --no-progress, but breaking flag differences between Yarn 1.x and Berry (2.x–4.x) frequently trip agents.
- Supports
--jsononinfo/audit(Berry) andlist(v1) - CLI flags diverge between v1 (
--frozen-lockfile) and Berry (--immutable)
--immutable / --frozen-lockfile guards lockfiles, while postinstall build scripts require --mode=skip-build (Berry) or --ignore-scripts (v1) on untrusted repos.
- Deterministic lockfile enforcement flags
Managed per-repo via Corepack (packageManager field) or installed via Homebrew/npm across macOS, Linux, and Windows.
- Cross-platform via Corepack, Homebrew, and npm
Strong monorepo workspace tooling (yarn workspaces foreach), zero-installs, and fast lockfile resolution.
- Mature monorepo workspace orchestration
Actively maintained under yarnpkg/berry (BSD-2-Clause).
- Official
yarnpkg/berryrepository
Well-structured Berry CLI docs at yarnpkg.com/cli, though search results often mix legacy v1 and v4 syntax.
- Official documentation at yarnpkg.com/cli
Security, Auth & Guardrails
Reads registry tokens from ~/.yarnrc.yml, ~/.npmrc, or YARN_NPM_AUTH_TOKEN environment variables.
BSD-2-Clause open-source CLI; completely free.
# Yarn (yarn) Agent Rules - Always run `yarn --version` first: v1 uses `--frozen-lockfile`, whereas Berry (v2+) uses `--immutable`. - Set `YARN_ENABLE_COLORS=0` on Berry and avoid running `yarn npm publish` without user confirmation.
Agent-Ready Command Recipes
Safe Read-Only Queries
yarn --version
Identifies whether the project runs Yarn Classic (1.x) or Berry (2.x–4.x) before choosing flags.
yarn info --json
Outputs resolved workspace package dependencies in newline-delimited JSON on Yarn Berry.
Controlled Writes & Previews
YARN_ENABLE_COLORS=0 yarn install --immutable
Installs exact dependencies in yarn.lock without modifying the lockfile or emitting color codes.
Strengths for Agents
- +
--immutableandyarn workspaces foreachmake Berry monorepo checks predictable. - + Outputs NDJSON on inspection commands (
yarn info --json,yarn npm audit --json).
Caveats & Pitfalls
- ! Yarn v1 (Classic) and Yarn v2–v4 (Berry) have incompatible flags (
--frozen-lockfilevs--immutable,yarn auditvsyarn npm audit). - ! Plug'n'Play (PnP) setups can break tools expecting physical
node_modulesunlessnodeLinker: node-modulesis configured.