← 返回命令列表

Linux command

bun-exec 命令

文本

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

常用示例

Run a package binary

bun exec [package]

Run a specific version

bun exec [package]@[version]

Force execution with Bun runtime

bun exec --bun [package]

Specify package when binary name differs

bun exec -p [package] [binary] [args...]

Run without installing

bun exec --no-install [binary]

说明

bun exec auto-installs and runs a package binary from npm. It is an alias for bun x and bunx, Bun's equivalent of npx. If the package binary is found in the local node_modules/.bin, that version is used. Otherwise, the package is downloaded into a global shared cache and executed from there. By default, Bun respects #!/usr/bin/env node shebangs in executables and runs them with Node.js. Use --bun to override this and run with Bun's runtime instead.

参数

--bun
Force the executable to run with Bun's runtime instead of Node.js, even if it contains a Node shebang. Must appear before the package name.
-p, --package _name_
Specify the package to install when the binary name differs from the package name.
--no-install
Do not auto-install the package; exit with an error if it is not already available.
--silent
Suppress installation output.
--verbose
Enable verbose output during installation.

FAQ

What is the bun-exec command used for?

bun exec auto-installs and runs a package binary from npm. It is an alias for bun x and bunx, Bun's equivalent of npx. If the package binary is found in the local node_modules/.bin, that version is used. Otherwise, the package is downloaded into a global shared cache and executed from there. By default, Bun respects #!/usr/bin/env node shebangs in executables and runs them with Node.js. Use --bun to override this and run with Bun's runtime instead.

How do I run a basic bun-exec example?

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

What does --bun do in bun-exec?

Force the executable to run with Bun's runtime instead of Node.js, even if it contains a Node shebang. Must appear before the package name.