LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

yarn-dlx

Run packages without installing

TLDR

Run a package without installing
$ yarn dlx [create-react-app] [my-app]
copy
Run a specific package version
$ yarn dlx [gatsby]@[4.0.0] new [my-site]
copy
Run a command from a different package
$ yarn dlx -p [typescript] tsc --version
copy
Run with quiet output
$ yarn dlx -q [cowsay] "Hello"
copy
Run a command with multiple package dependencies
$ yarn dlx -p [typescript] -p [ts-node] ts-node --transpile-only -e "console.log('hello')"
copy
Scaffold a Next.js app
$ yarn dlx create-next-app [my-app]
copy

SYNOPSIS

yarn dlx [-p package] [-q] command [args]

DESCRIPTION

yarn dlx runs a package in a temporary environment without permanently installing it. This is the Yarn equivalent of npx, useful for one-off commands like project scaffolding tools.The command downloads the specified package to a temporary location, executes the package's binary scripts within the current working directory, and cleans up afterward. It's commonly used with generators like create-react-app, create-next-app, and gatsby that create new project structures.By default, yarn dlx uses the command name to determine which package to install. Use -p to specify a different package when the command name differs from the package name.

PARAMETERS

-p package, --package package

Designate which package to install before executing the command. Can be specified multiple times to install multiple packages.
-q, --quiet
Suppress detailed installation logs and report only essential error messages.

INSTALL

sudo pacman -S yarn
copy
sudo apk add yarn
copy
sudo zypper install yarn
copy
brew install yarn
copy
nix profile install nixpkgs#yarn
copy

CAVEATS

yarn dlx is available in Yarn 2+ (Berry) only; Yarn 1.x does not include this command. Using dlx for packages needed repeatedly is not recommended since Yarn doesn't track dlx-installed packages, making builds non-deterministic. For repeated use, install packages normally with yarn add.

HISTORY

yarn dlx was introduced in Yarn 2 (Berry) released in 2020 as part of the modernized Yarn architecture. It provides functionality similar to npx but integrated with Yarn's package resolution and caching system.

SEE ALSO

yarn(1), npx(1), npm(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid