yarn-dlx
Run packages without installing
TLDR
Run a package without installing
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 it, 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
Install and run command from specified package instead of inferring from command name-q, --quiet
Suppress informational output during execution
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.
