← 返回命令列表

Linux command

pnpx 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run package without installing

pnpx [package] [args]

Run specific version

pnpx [package]@[version] [args]

Run with package name different from command

pnpx --package [package] [command]

Install multiple packages

pnpx --package [pkg1] --package [pkg2] [command]

说明

pnpx executes npm packages without permanently installing them, similar to npx. It downloads the package to a temporary location, runs the specified command, and cleans up afterward. This is a deprecated alias for pnpm dlx; prefer using pnpm dlx directly. Use --package to specify a package name when the executable name differs from the package name. The @version suffix allows running a specific package version. Packages executed by pnpx are allowed to run postinstall scripts by default.

参数

--package _PKG_
Package to install (if different from command). Can be specified multiple times.

FAQ

What is the pnpx command used for?

pnpx executes npm packages without permanently installing them, similar to npx. It downloads the package to a temporary location, runs the specified command, and cleans up afterward. This is a deprecated alias for pnpm dlx; prefer using pnpm dlx directly. Use --package to specify a package name when the executable name differs from the package name. The @version suffix allows running a specific package version. Packages executed by pnpx are allowed to run postinstall scripts by default.

How do I run a basic pnpx example?

Run `pnpx [package] [args]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --package _PKG_ do in pnpx?

Package to install (if different from command). Can be specified multiple times.