npx
npx runs a package's command without installing it permanently.
In this page:
Syntax
npx package_name arguments
npx
npx downloads a package temporarily (or uses a local one) and runs its binary. It is ideal for scaffolding tools like create-react-app or one-off tasks. Local binaries in node_modules/.bin are also found by npx.
Note:
Use npx package@version to pin the version you run.
Example: npx
$ npx cowsay "Hello npx"
$ npx eslint .
$ npx create-vite@latest my-app
$ npx --yes serve .
⚠️ Run this in your own terminal or Node.js environment.
Related Topics
Common Mistakes
- Assuming npx installs globally
- Running untrusted packages blindly
- Forgetting the version can change between runs
Chapter Summary
- npx runs package binaries
- No permanent install needed
- Finds local node_modules/.bin tools
- Pin versions for repeatability
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: