Compare

npm vs npx

The difference between the package manager itself and running package binaries on demand.

`npm` manages packages, scripts, and your dependency graph. `npx` runs package binaries, often without requiring a permanent local installation first.

Use npm When

You are installing dependencies, managing versions, or running package scripts.

You want a package to become part of the project or global environment.

Use npx When

You want to run a tool once without committing to an install.

You are using a package binary such as a scaffolder or formatter command.

Rule of Thumb

npm manages. npx executes.

Want the short version? Browse the compact sheet views and save the commands you use most into a Cheatbook.