Skip to content

Instantly share code, notes, and snippets.

@UbuntuEvangelist
Created June 23, 2022 22:30
Show Gist options
  • Select an option

  • Save UbuntuEvangelist/d69cde2b282cad031f554bd349dc006f to your computer and use it in GitHub Desktop.

Select an option

Save UbuntuEvangelist/d69cde2b282cad031f554bd349dc006f to your computer and use it in GitHub Desktop.
Yarn Command List
━━━ Yarn Package Manager - 3.2.1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
$ yarn <command>
━━━ General commands ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...
add dependencies to the project
yarn bin [-v,--verbose] [--json] [name]
get the path to a binary script
yarn cache clean [--mirror] [--all]
remove the shared cache files
yarn config [-v,--verbose] [--why] [--json]
display the current configuration
yarn config get [--json] [--no-redacted] <name>
read a configuration settings
yarn config set [--json] [-H,--home] <name> <value>
change a configuration settings
yarn config unset [-H,--home] <name>
unset a configuration setting
yarn dedupe [-s,--strategy #0] [-c,--check] [--json] [--mode #0] ...
deduplicate dependencies with overlapping ranges
yarn dlx [-p,--package #0] [-q,--quiet] <command> ...
run a package in a temporary environment
yarn exec <commandName> ...
execute a shell script
yarn explain [--json] [code]
explain an error code
yarn explain peer-requirements [hash]
explain a set of peer requirements
yarn info [-A,--all] [-R,--recursive] [-X,--extra #0] [--cache] [--dependents] [--manifest] [--name-only] [--virtuals] [--json] ...
see information related to packages
yarn init [-p,--private] [-w,--workspace] [-i,--install]
create a new package
yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]
install the project dependencies
yarn link [-A,--all] [-p,--private] [-r,--relative] <destination>
connect the local project to another one
yarn node ...
run node with the hook already setup
yarn npm audit [-A,--all] [-R,--recursive] [--environment #0] [--json] [--severity #0]
perform a vulnerability audit against the installed packages
yarn pack [--install-if-needed] [-n,--dry-run] [--json] [-o,--out #0]
generate a tarball from the active workspace
yarn patch [--json] <package>
prepare a package for patching
yarn patch-commit [-s,--save] <patchFolder>
generate a patch out of a directory
yarn rebuild ...
rebuild the project's native packages
yarn remove [-A,--all] [--mode #0] ...
remove dependencies from the project
yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...
run a script defined in the package.json
yarn set resolution [-s,--save] <descriptor> <resolution>
enforce a package resolution
yarn set version [--only-if-needed] <version>
lock the Yarn version used by the project
yarn set version from sources [--path #0] [--repository #0] [--branch #0] [--plugin #0] [--no-minify] [-f,--force] [--skip-plugins]
build Yarn from master
yarn unlink [-A,--all] ...
disconnect the local project from another one
yarn unplug [-A,--all] [-R,--recursive] [--json] ...
force the unpacking of a list of packages
yarn up [-i,--interactive] [-E,--exact] [-T,--tilde] [-C,--caret] [-R,--recursive] [--mode #0] ...
upgrade dependencies across the project
yarn why [-R,--recursive] [--json] [--peers] <package>
display the reason why a package is needed
━━━ Npm-related commands ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
yarn npm info [-f,--fields #0] [--json] ...
show information about a package
yarn npm login [-s,--scope #0] [--publish]
store new login info to access the npm registry
yarn npm logout [-s,--scope #0] [--publish] [-A,--all]
logout of the npm registry
yarn npm publish [--access #0] [--tag #0] [--tolerate-republish] [--otp #0]
publish the active workspace to the npm registry
yarn npm tag add <package> <tag>
add a tag for a specific version of a package
yarn npm tag list [--json] [package]
list all dist-tags of a package
yarn npm tag remove <package> <tag>
remove a tag from a package
yarn npm whoami [-s,--scope #0] [--publish]
display the name of the authenticated user
━━━ Plugin-related commands ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
yarn plugin import <name>
download a plugin
yarn plugin import from sources [--path #0] [--repository #0] [--branch #0] [--no-minify] [-f,--force] <name>
build a plugin from sources
yarn plugin list [--json]
list the available official plugins
yarn plugin remove <name>
remove a plugin
yarn plugin runtime [--json]
list the active plugins
━━━ Workspace-related commands ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
yarn workspace <workspaceName> <commandName> ...
run a command within the specified workspace
yarn workspaces list [--since] [-R,--recursive] [-v,--verbose] [--json]
list all available workspaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment