Run an installed package's executable bin.

Synopsis

npx [--force] [--global] <pkg-or-bin> [args...]

Description

Resolves <pkg-or-bin> to a bin (nearest node_modules/.bin/<name>, else the package's package.json bin field) and runs it through the JS runtime, forwarding argv and stdin. Exit codes propagate.

Options

--force Install a package even when a SLICC built-in shadows it.

--global Resolve only from the shared global prefix (/shared/lib/node_modules).

-h, --help Show this help message.

Examples

$ npx tsc --version

Run a locally installed tsc without a global install.

$ npx --global some-cli --help

Run a CLI resolved only from the global prefix.

Notes

If a package name matches a SLICC built-in command, npx will not shadow it unless --force is given.

See Also

npm, i, node