Fixing zsh: npx command not found - kebalicious/npx-kebal GitHub Wiki

If you're seeing the error:

zsh: npx command not found

It usually means that Node.js and npm (which includes npx) are either not installed or not properly configured in your system.


✅ Step-by-Step Fix

1. Install Node.js and npm

You can download and install Node.js (which includes npm and npx) from the official site:

👉 https://nodejs.org/

macOS (using Homebrew):

brew install node

2. Verify Installation

After installation, confirm everything is working by running:

node -v
npm -v

You should see version numbers as output.

3. Check if npx is Available

Since npx is bundled with npm (v5.2+), check if it's available:

npx -v

If this command fails, continue with the steps below.

4. Add npm to PATH (if necessary)

Sometimes the system can't find npx because the npm binaries aren't in your shell's PATH.

Check where npm is installed:

which npm

Then add its bin path to your .zshrc:

Edit your ~/.zshrc file:

nano ~/.zshrc

Add this line (replace /path/to/npm/bin with your actual path):

export PATH="$PATH:/path/to/npm/bin"

Reload your shell config:

source ~/.zshrc

🎉 Done!

Now you should be able to use:

npx create-something

without issues.