YARN(1)

๐Ÿ“ฆ
version 4.1.0 ยท 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

โœจ NAME โœจ

yarn โ€” Yarn: Fast, reliable, and secure dependency management. That's the official tagline, and honestly? It ate. ๐Ÿ’…

๐Ÿ’– DESCRIPTION ๐Ÿ’–

Okay bestie, so this whole page is about the Yarn Package Manager, version 4.0.1. The main-character invocation is literally just:

yarn <command>

Then we got a whole menu of commands, grouped by vibe. Let's go. โœจ


๐ŸŒธ General commands ๐ŸŒธ

  • yarn add โ€” add dependencies to the project. Like adding new faves to the group chat, but for packages. ๐Ÿ’–
yarn add [--json] [-F,--fixed] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...
  • yarn bin โ€” get the path to a binary script. Need the exact location? Say less. ๐Ÿ“
yarn bin [-v,--verbose] [--json] [name]
  • yarn cache clean โ€” remove the shared cache files. Bye bye, cache clutter. ๐Ÿงน
yarn cache clean [--mirror] [--all]
  • yarn config โ€” display the current configuration. Show me the settings, bestie. ๐Ÿ‘€
yarn config [--no-defaults] [--json] ...
  • yarn config get โ€” read a configuration settings. Get that one config value. ๐Ÿ”
yarn config get [--why] [--json] [--no-redacted] <name>
  • yarn config set โ€” change a configuration settings. Change it up. โœจ
yarn config set [--json] [-H,--home] <name> <value>
  • yarn config unset โ€” unset a configuration setting. Poof, gone. ๐Ÿ’…
yarn config unset [-H,--home] <name>
  • yarn dedupe โ€” deduplicate dependencies with overlapping ranges. Clean up the overlap, no cap. ๐Ÿงผ
yarn dedupe [-s,--strategy #0] [-c,--check] [--json] [--mode #0] ...
  • yarn dlx โ€” run a package in a temporary environment. Temporary, like my attention span. ๐Ÿ’€
yarn dlx [-p,--package #0] [-q,--quiet] <command> ...
  • yarn exec โ€” execute a shell script. Run it. ๐Ÿ”ฅ
yarn exec <commandName> ...
  • yarn explain โ€” explain an error code. Yarn therapy session. ๐Ÿ˜ญ
yarn explain [--json] [code]
  • yarn explain peer-requirements โ€” explain a set of peer requirements. Peer pressure, explained. ๐Ÿ‘‘
yarn explain peer-requirements [hash]
  • yarn info โ€” see information related to packages. Spill the tea. ๐Ÿต
yarn info [-A,--all] [-R,--recursive] [-X,--extra #0] [--cache] [--dependents] [--manifest] [--name-only] [--virtuals] [--json] ...
  • yarn init โ€” create a new package. New package, who dis? ๐ŸŽ€
yarn init [-p,--private] [-w,--workspace] [-i,--install] [-n,--name #0]
  • yarn install โ€” install the project dependencies. The classic. Install szn. ๐Ÿ“ฆ
yarn install [--json] [--immutable] [--immutable-cache] [--refresh-lockfile] [--check-cache] [--check-resolutions] [--inline-builds] [--mode #0]
  • yarn link โ€” connect the local project to another one. Link up. ๐Ÿ”—
yarn link [-A,--all] [-p,--private] [-r,--relative] ...
  • yarn node โ€” run node with the hook already setup. Node, but pre-hooked. ๐Ÿช
yarn node ...
  • yarn npm audit โ€” perform a vulnerability audit against the installed packages. Security check, periodt. ๐Ÿ›ก๏ธ
yarn npm audit [-A,--all] [-R,--recursive] [--environment #0] [--json] [--no-deprecations] [--severity #0] [--exclude #0] [--ignore #0]
  • yarn pack โ€” generate a tarball from the active workspace. Tarball time. ๐ŸŽ
yarn pack [--install-if-needed] [-n,--dry-run] [--json] [-o,--out #0]
  • yarn patch โ€” prepare a package for patching. Patch it up. ๐Ÿฉน
yarn patch [-u,--update] [--json] <package>
  • yarn patch-commit โ€” generate a patch out of a directory. Commit that patch. ๐Ÿ’พ
yarn patch-commit [-s,--save] <patchFolder>
  • yarn rebuild โ€” rebuild the project's native packages. Rebuild era. ๐Ÿ”จ
yarn rebuild ...
  • yarn remove โ€” remove dependencies from the project. Unstan. ๐Ÿšซ
yarn remove [-A,--all] [--mode #0] ...
  • yarn run โ€” run a script defined in the package.json. Script go brrr. ๐Ÿƒ
yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] [--require #0] <scriptName> ...
  • yarn set resolution โ€” enforce a package resolution. Enforce it, period. โš–๏ธ
yarn set resolution [-s,--save] <descriptor> <resolution>
  • yarn set version โ€” lock the Yarn version used by the project. Lock it in. ๐Ÿ”’
yarn set version [--yarn-path] [--only-if-needed] <version>
  • yarn set version from sources โ€” build Yarn from master. Build from source, main character energy. ๐Ÿ› ๏ธ
yarn set version from sources [--path #0] [--repository #0] [--branch #0] [--plugin #0] [-n,--dry-run] [--no-minify] [-f,--force] [--skip-plugins]
  • yarn stage โ€” add all yarn files to your vcs. Stage it. ๐ŸŽฌ
yarn stage [-c,--commit] [-r,--reset] [-n,--dry-run]
  • yarn unlink โ€” disconnect the local project from another one. Unlink, bye. ๐Ÿ‘‹
yarn unlink [-A,--all] ...
  • yarn unplug โ€” force the unpacking of a list of packages. Unplug it. ๐Ÿ”Œ
yarn unplug [-A,--all] [-R,--recursive] [--json] ...
  • yarn up โ€” upgrade dependencies across the project. Glow-up for deps. โฌ†๏ธ
yarn up [-i,--interactive] [-F,--fixed] [-E,--exact] [-T,--tilde] [-C,--caret] [-R,--recursive] [--mode #0] ...
  • yarn why โ€” display the reason why a package is needed. Why tho? ๐Ÿค”
yarn why [-R,--recursive] [--json] [--peers] <package>

  • yarn constraints โ€” check that the project constraints are met. Rules are rules. ๐Ÿ“
yarn constraints [--fix] [--json]
  • yarn constraints query โ€” query the constraints fact database. Query szn. ๐Ÿ”Ž
yarn constraints query [--json] <query>
  • yarn constraints source โ€” print the source code for the constraints. Source code reveal. ๐Ÿ“œ
yarn constraints source [-v,--verbose]

๐ŸŒธ Interactive commands ๐ŸŒธ

  • yarn search โ€” open the search interface. Search interface, let's go. ๐Ÿ”
yarn search
  • yarn upgrade-interactive โ€” open the upgrade interface. Interactive upgrade, cute. ๐ŸŽฎ
yarn upgrade-interactive

  • yarn npm info โ€” show information about a package. Npm tea. โ˜•
yarn npm info [-f,--fields #0] [--json] ...
  • yarn npm login โ€” store new login info to access the npm registry. Login time. ๐Ÿ”
yarn npm login [-s,--scope #0] [--publish] [--always-auth]
  • yarn npm logout โ€” logout of the npm registry. Logout, bye. ๐Ÿšช
yarn npm logout [-s,--scope #0] [--publish] [-A,--all]
  • yarn npm publish โ€” publish the active workspace to the npm registry. Publish it, slay. ๐Ÿš€
yarn npm publish [--access #0] [--tag #0] [--tolerate-republish] [--otp #0]
  • yarn npm tag add โ€” add a tag for a specific version of a package. Tag it. ๐Ÿท๏ธ
yarn npm tag add <package> <tag>
  • yarn npm tag list โ€” list all dist-tags of a package. List the tags. ๐Ÿ“‹
yarn npm tag list [--json] [package]
  • yarn npm tag remove โ€” remove a tag from a package. Tag removed. โŒ
yarn npm tag remove <package> <tag>
  • yarn npm whoami โ€” display the name of the authenticated user. Who am I? ๐Ÿ‘ค
yarn npm whoami [-s,--scope #0] [--publish]

  • yarn plugin check โ€” find all third-party plugins that differ from their own spec. Plugin vibe check. โœ…
yarn plugin check [--json]
  • yarn plugin import โ€” download a plugin. Import that plugin. ๐Ÿ“ฅ
yarn plugin import [--checksum] <name>
  • yarn plugin import from sources โ€” build a plugin from sources. Build from source. ๐Ÿ—๏ธ
yarn plugin import from sources [--path #0] [--repository #0] [--branch #0] [--no-minify] [-f,--force] <name>
  • yarn plugin list โ€” list the available official plugins. Official plugin list. ๐Ÿ“ƒ
yarn plugin list [--json]
  • yarn plugin remove โ€” remove a plugin. Plugin out. ๐Ÿ—‘๏ธ
yarn plugin remove <name>
  • yarn plugin runtime โ€” list the active plugins. Active plugins, let's see. โšก
yarn plugin runtime [--json]

  • yarn version โ€” apply a new version to the current package. Version bump, new era. ๐ŸŽ‰
yarn version [-d,--deferred] [-i,--immediate] <strategy>
  • yarn version apply โ€” apply all the deferred version bumps at once. Apply all the bumps. ๐Ÿ’ฅ
yarn version apply [--all] [--dry-run] [--prerelease] [-R,--recursive] [--json]
  • yarn version check โ€” check that all the relevant packages have been bumped. Check those bumps. ๐Ÿ”
yarn version check [-i,--interactive]

  • yarn workspace โ€” run a command within the specified workspace. Workspace-specific command. ๐Ÿข
yarn workspace <workspaceName> <commandName> ...
  • yarn workspaces focus โ€” install a single workspace and its dependencies. Focus on one. ๐ŸŽฏ
yarn workspaces focus [--json] [--production] [-A,--all] ...
  • yarn workspaces foreach โ€” run a command on all workspaces. For each workspace, do the thing. ๐Ÿ”
yarn workspaces foreach [--from #0] [-A,--all] [-R,--recursive] [-W,--worktree] [-v,--verbose] [-p,--parallel] [-i,--interlaced] [-j,--jobs #0] [-t,--topological] [--topological-dev] [--include #0] [--exclude #0] [--no-private] [--since] [-n,--dry-run] <commandName> ...
  • yarn workspaces list โ€” list all available workspaces. List the workspaces. ๐Ÿ“‹
yarn workspaces list [--since] [-R,--recursive] [--no-private] [-v,--verbose] [--json]

You can also print more details about any of these commands by calling them with the -h,--help flag right after the command name. That's the cheat code, bestie. ๐Ÿ’…

Anyway, this whole page is brought to you by yarnpkg 4.0.1, dated October 2023, and it's serving YARN(1) realness. Bye bestie, go install something iconic. ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from