Linux command
bunx 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run package executable
bunx [prisma] migrate
Run specific package version
bunx [email protected] [app.js]
Run when binary name differs from package
bunx -p @angular/cli ng new [my-app]
Force run with Bun runtime
bunx --bun vite dev
Run prettier on file
bunx prettier [file.js]
Run create-react-app
bunx create-react-app [my-app]
说明
bunx auto-installs and runs executables from npm packages. It's Bun's equivalent of npx, roughly 100x faster for locally installed packages due to Bun's fast startup times. Packages not found in local node_modules are automatically installed into a global shared cache.
参数
- -p, --package _name_
- Specify the package to install when the binary name differs from the package name.
- --bun
- Force running with Bun even if the executable carries a Node shebang.
- --no-install
- Fail instead of fetching when the package is not already cached.
- --silent
- Suppress installation-related output.
- --verbose
- Print extra detail during installation.
FAQ
What is the bunx command used for?
bunx auto-installs and runs executables from npm packages. It's Bun's equivalent of npx, roughly 100x faster for locally installed packages due to Bun's fast startup times. Packages not found in local node_modules are automatically installed into a global shared cache.
How do I run a basic bunx example?
Run `bunx [prisma] migrate` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p, --package _name_ do in bunx?
Specify the package to install when the binary name differs from the package name.