Npx
Basic Commands
Execute a package without installing it
npx <package_name>
Run a specific package version
npx <package_name>@<version>
Run a local project’s binary
npx <binary_name>
Execute a command from a GitHub repository
npx github:<user>/<repo>
Create a new project with a generator
npx <generator_name> <project_name>
Miscellaneous Commands
Run a command with no cache
npx --no-install <package_name>
View NPX version
npx --version
Clear NPX cache
npx clear-npx-cache
Create a new React app
npx create-react-app <app_name>
Create a new Next.js app
npx create-next-app <app_name>
Create a new NestJS project
npx @nestjs/cli new <project_name>
Advanced Usage
Execute a script from a gist
npx gist.github.com/<gist_id>
Run a package in a different Node version (via npx)
npx -p node@<version> <command>
Run a package and pass additional parameters
npx <package_name> -- <parameters>
Last modified: 08 September 2024