rush exec
rush exec <binary> [args...] [flags]Runs a binary installed in node_modules/.bin directly — without defining a script in package.json. Unlike rush run, exec bypasses the scripts section entirely and invokes the binary straight.
| Flag | Default | Description |
|---|---|---|
--verbose | false | Print detailed execution information |
Examples
Section titled “Examples”Run ESLint on the current directory:
rush exec eslint .Type-check without emitting files:
rush exec tsc -- --noEmitFormat all files with Prettier:
rush exec prettier -- --write .Build with webpack in production mode:
rush exec webpack -- --mode productionrush exec vs rush run
Section titled “rush exec vs rush run”rush run | rush exec | |
|---|---|---|
| Source | package.json scripts | node_modules/.bin |
| Pre/post hooks | Yes | No |
| Use case | Defined project workflows | Ad-hoc binary invocation |
Use rush run for scripts you’ve defined in package.json. Use rush exec when you want to call a tool directly with custom arguments, or when no script is defined.