Error Encyclopedia

Command Not Found Error

Fix 'command not found' errors in terminal and CLI. Learn how to fix PATH issues, install missing tools, and use npx for Node.js packages.

What Does This Error Mean?

The 'command not found' error means your shell cannot find an executable with that name in any of the directories listed in the PATH environment variable.

Common Causes

1

The software is not installed on your system

2

The software is installed but not in your PATH

3

PATH variable is misconfigured or missing common directories

4

Node.js/npm installed but not added to PATH (Windows)

5

Using a command that requires a different shell or environment

6

Typo in the command name

How to Fix It

Check if the command is installed

Use which or where to check if the command exists anywhere.

# Linux/macOS: check if command is available
which node
which npm

# Windows
where node
where npm

# If not found, install it
# Node.js: https://nodejs.org

Fix PATH configuration

Add common binary directories to your PATH.

# Linux/macOS: add to ~/.bashrc or ~/.zshrc
export PATH="$PATH:/usr/local/bin"
export PATH="$PATH:$HOME/.npm-global/bin"
export PATH="$PATH:./node_modules/.bin"

# Windows: add to system PATH via GUI
# System Properties → Environment Variables → PATH
# Add: C:\Program Files\nodejs\

Use npx for Node.js packages

npx runs Node.js packages without installing them globally.

# Instead of installing globally
npm install -g create-react-app
create-react-app my-app

# Use npx instead (no global install)
npx create-react-app my-app

# Other examples
npx prettier --write .
npx eslint .
npx tsc --init

Related Tools

Use these tools to debug and fix this error:

Related Errors

Other common errors in this category: