yarn [command]

Manage packages and run scripts

Arguments

NameDescription
command

Subcommands

NameDescription
addInstalls a package and any packages that it depends on
auditPerform a vulnerability audit against the installed packages
autocleanCleans and removes unnecessary files from package dependencies
binDisplays the location of the yarn bin folder
cacheYarn cache list will print out every cached package
configConfigure yarn
createCreates new projects from any create-* starter kits
exec
generate-lock-entryGenerates a lock file entry
globalManage yarn globally
helpOutput usage information
importGenerates yarn.lock from an npm package-lock.json file
infoShow information about a package
initInteractively creates or updates a package.json file
installInstall all the dependencies listed within package.json
licenses
linkSymlink a package folder during development
listLists all dependencies for the current working directory
loginStore registry username and email
logoutClear registry username and email
node
outdatedChecks for outdated package dependencies
ownerManage package owners
packCreates a compressed gzip archive of package dependencies
policiesDefines project-wide policies for your project
publishPublishes a package to the npm registry
removeRemove installed package
runRuns a defined package script
tagAdd, remove, or list tags on a package
teamMaintain team memberships
unlinkUnlink a previously created symlink for a package
unplug
upgradeUpgrades packages to their latest version based on the specified range
upgrade-interactiveUpgrades packages in interactive mode
versionUpdate version of your package
versionsDisplays version information of the currently installed Yarn, Node.js, and its dependencies
whyShow information about why a package is installed
workspaceManage workspace
workspacesShow information about your workspaces
setSet global Yarn options

Options

NameDescription
--disable-pnpDisable the Plug'n'Play installation
--emoji <bool>Enable emoji in output (default: true)
--enable-pnp, --pnpEnable the Plug'n'Play installation
--flatOnly allow one version of a package
--focusFocus on a single workspace by installing remote copies of its sibling workspaces
--forceInstall and build packages even if they were built before, overwrite lockfile
--frozen-lockfileDon't generate a lockfile and fail if an update is needed
--global-folder <arg>Specify a custom folder to store global packages
--harSave HAR output of network traffic
--https-proxy <path>
--ignore-enginesIgnore engines check
--ignore-optionalIgnore optional dependencies
--ignore-platformIgnore platform checks
--ignore-scriptsDon't run lifecycle scripts
--jsonFormat Yarn log messages as lines of JSON (see jsonlines.org)
--link-duplicatesCreate hardlinks to the repeated modules in node_modules
--link-folder <arg>Specify a custom folder to store global links
--modules-folder <arg>Rather than installing modules into the node_modules folder relative to the cwd, output them here
--mutex <type> <specifier>Use a mutex to ensure only one yarn instance is executing
--network-concurrency <number>Maximum number of concurrent network requests
--network-timeout <milliseconds>TCP timeout for network requests
--no-bin-linksDon't generate bin links when setting up packages
--no-default-rcPrevent Yarn from automatically detecting yarnrc and npmrc files
--no-lockfileDon't read or generate a lockfile
--non-interactiveDo not show interactive prompts
--no-node-version-checkDo not warn when using a potentially unsupported Node version
--no-progressDisable progress bar
--offlineTrigger an error if any required dependencies are not available in local cache
--otp <otpcode>One-time password for two factor authentication
--prefer-offlineUse network only if dependencies are not available in local cache
--preferred-cache-folder <arg>Specify a custom folder to store the yarn cache if possible
--prod, --production <arg>
--proxy <host>
--pure-lockfileDon't generate a lockfile
--registry <url>Override configuration registry
-s, --silentSkip Yarn console logs, other types of logs (script output) will be printed
--scripts-prepend-node-path <arg>Prepend the node executable dir to the PATH in scripts
--skip-integrity-checkRun install without checking if node_modules is installed
--strict-semver
-s, --silentSkip Yarn console logs
--no-default-rcPrevent Yarn from automatically detecting yarnrc and npmrc files
--use-yarnrc <path>Specifies a yarnrc file that Yarn should use (.yarnrc only, not .npmrc) (default: )
--verboseOutput verbose messages on internal operations
--offlineTrigger an error if any required dependencies are not available in local cache
--prefer-offlineUse network only if dependencies are not available in local cache
--enable-pnp, --pnpEnable the Plug'n'Play installation
--jsonFormat Yarn log messages as lines of JSON
--ignore-scriptsDon't run lifecycle scripts
--harSave HAR output of network traffic
--ignore-platformIgnore platform checks
--ignore-enginesIgnore engines check
--ignore-optionalIgnore optional dependencies
--forceInstall and build packages even if they were built before, overwrite lockfile
--skip-integrity-checkRun install without checking if node_modules is installed
--check-filesInstall will verify file tree of packages for consistency
--no-bin-linksDon't generate bin links when setting up packages
--flatOnly allow one version of a package
--prod, --productionInstruct Yarn to ignore NODE_ENV and take its production-or-not status from this flag instead
--no-lockfileDon't read or generate a lockfile
--pure-lockfileDon't generate a lockfile
--frozen-lockfileDon't generate a lockfile and fail if an update is needed
--update-checksumsUpdate package checksums from current repository
--link-duplicatesCreate hardlinks to the repeated modules in node_modules
--link-folder <path>Specify a custom folder to store global links
--global-folder <path>Specify a custom folder to store global packages
--modules-folder <path>Rather than installing modules into the node_modules folder relative to the cwd, output them here
--preferred-cache-folder <path>Specify a custom folder to store the yarn cache if possible
--cache-folder <path>Specify a custom folder that must be used to store the yarn cache
--mutex <type[:specifier]>Use a mutex to ensure only one yarn instance is executing
--emoji <arg>Enables emoji in output
--cwd <cwd>Working directory to use
--proxy, --https-proxy <host>
--registry <url>Override configuration registry
--no-progressDisable progress bar
--network-concurrency <number>Maximum number of concurrent network requests
--network-timeout <milliseconds>TCP timeout for network requests
--non-interactiveDo not show interactive prompts
--scripts-prepend-node-pathPrepend the node executable dir to the PATH in scripts
--no-node-version-checkDo not warn when using a potentially unsupported Node version
--focusFocus on a single workspace by installing remote copies of its sibling workspaces
--otp <otpcode>One-time password for two factor authentication
-v, --versionOutput the version number
-h, --helpOutput usage information