How to fix npm ERR! code E404 npm ERR! 404 Not Found - npx: command not found in npm

npmINTERMEDIATEMEDIUMUpdated Dec 3, 2025ยท 107 views

The "npx: command not found" error occurs when npx is not installed or not in your system PATH. npx comes bundled with npm 5.2.0+ and is used to run package binaries without global installation.

Quick fix

Fixes npm ERR! code E404 npm ERR! 404 Not Found - npx: command not found

npm --version
  1. Check npm version
  2. Install npx manually if needed
  3. Add npm to PATH
  4. Fix nvm setup
npm โ€” error
npm --version
npm ERR! code E404
npm ERR! 404 Not Found - npx: command not found

What this error means

npx is a package runner that comes bundled with npm (version 5.2.0 and later). It allows you to run CLI tools from npm packages without installing them globally. When you see "npx: command not found," either: 1. npm is too old (pre-5.2.0) and doesn't include npx 2. npm's bin directory isn't in your system PATH 3. Node.js/npm installation is incomplete or corrupted npx is particularly useful for running one-off commands (like create-react-app) or using different versions of tools per project.

Typical symptoms

  • bash: npx: command not found (Linux/macOS)
  • 'npx' is not recognized (Windows)
  • npm commands work but npx doesn't
  • npx worked before but stopped after Node update

Common causes

  1. npm version older than 5.2.0
  2. npm bin directory not in PATH
  3. Incomplete Node.js installation
  4. nvm installation without proper shell integration
  5. Windows PATH not updated after Node install

How to fix "npm ERR! code E404 npm ERR! 404 Not Found - npx: command not found"

1Check npm version

Verify npm version (needs 5.2.0+):

bash
npm --version

If below 5.2.0, upgrade:

bash
npm install -g npm@latest
2Install npx manually if needed

If npx is still missing:

bash
npm install -g npx

npx --version
3Add npm to PATH

Get npm's bin directory and add to PATH:

bash
# Find npm prefix
npm config get prefix

# Add to PATH (Linux/macOS)
# Add this to ~/.bashrc or ~/.zshrc:
export PATH=$(npm config get prefix)/bin:$PATH

source ~/.bashrc

Windows: Add the npm path to System Environment Variables.

4Fix nvm setup

If using nvm, ensure proper shell integration:

bash
# Add to ~/.bashrc or ~/.zshrc:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

# Reload
source ~/.bashrc

# Test
npx --version
5Reinstall Node.js if needed

If still not working, reinstall Node.js:

macOS (Homebrew):

bash
brew uninstall node
brew install node

Windows/Linux: Download installer from nodejs.org and run.

Verify:

bash
node --version
npm --version
npx --version

Advanced notes

npx vs npm install -g:

Use npx when:
- Running a command once (npx create-react-app my-app)
- You want the latest version always
- Avoiding global package pollution

Use npm install -g when:
- You use the tool frequently
- You need a specific version consistently
- The tool doesn't change often

npx first checks local node_modules/.bin, then global packages, then downloads from npm if needed.

Frequently asked questions

What does "npm ERR! code E404 npm ERR! 404 Not Found - npx: command not found" mean?
0 and later). It allows you to run CLI tools from npm packages without installing them globally. When you see "npx: command not found," either: 1.
How do I fix "npm ERR! code E404 npm ERR! 404 Not Found - npx: command not found"?
The "npx: command not found" error occurs when npx is not installed or not in your system PATH. npx comes bundled with npm 5.2.0+ and is used to run package binaries without global installation.
What causes "npm ERR! code E404 npm ERR! 404 Not Found - npx: command not found"?
npm version older than 5.2.0 npm bin directory not in PATH Incomplete Node.js installation
Is the "npm ERR! code E404 npm ERR! 404 Not Found - npx: command not found" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading