Path Configuration
Troubleshoot PATH configuration problems on macOS, Linux, and Windows. Ensure your shell can find npm and npx commands.
The Problem
Your shell cannot find npm, npx, or Memoria commands even though Node.js is installed.
Common Causes
- Node.js bin directory not in PATH
- Shell configuration file not sourced
- Wrong shell configuration file edited
- PATH variable overwritten
Solutions
Find Your npm Location
Determine where npm is installed.
which npm
# or on Windows
where npmAdd to Shell Config (macOS/Linux)
Add the npm bin directory to your shell configuration.
# For zsh (default on macOS)
echo 'export PATH="$PATH:/usr/local/bin"' >> ~/.zshrc
source ~/.zshrc
# For bash
echo 'export PATH="$PATH:/usr/local/bin"' >> ~/.bashrc
source ~/.bashrcWindows PATH Setup
Open System Properties > Environment Variables and add the Node.js installation directory to your PATH variable.