cmdxray / commands / yarn

What does yarn do?

an alternative Node.js package manager.

▸ Explain your own yarn command →

yarn examples, explained

$ yarn add -D typescript

  • yarnan alternative Node.js package manager
  • addadd a dependency to the project
  • -Dadd to devDependencies
  • typescriptan argument passed to the command

$ yarn install --frozen-lockfile

  • yarnan alternative Node.js package manager
  • installinstall project dependencies
  • --frozen-lockfilefail rather than update the lockfile (Yarn 1)

yarn subcommands

install — install project dependenciesadd — add a dependency to the projectremove — remove a dependencyrun — run a script defined in package.jsonbuild — run the build scripttest — run the test scriptupgrade — upgrade dependencies to their latest allowed versionsdlx — download and run a package one-off (Yarn Berry)why — explain why a package is installed

yarn flags & options

-Dadd to devDependencies
--devadd to devDependencies
--frozen-lockfilefail rather than update the lockfile (Yarn 1)
--immutablefail if the lockfile would change (Yarn Berry)
--productionskip devDependencies
--globaloperate on the global package set

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.