npm Command Not Found: Check Node.js, npm and PATH
If your terminal says npm is not found or not recognized, first confirm that Node.js and npm are installed and visible to the current shell.
Check whether your current shell can find npm. Use the command for your operating system below.
Windows: where npm
macOS/Linux: command -v npmVerify: If a path is returned, npm exists and the problem may be shell/session or command context. If no path is returned, verify the Node.js/npm installation and PATH.
Why this happens
The shell can only run npm when the executable or launcher is installed and reachable through the environment PATH. A fresh installation can also require closing and reopening the terminal before the updated PATH is visible.
Diagnose before changing more
Run node --version. If Node.js is also missing, fix the Node.js installation before treating npm as a separate problem.
Close the terminal completely and open a new one so the shell reads the updated environment.
If a path exists, inspect which installation it points to before reinstalling anything.
Fix #2 — repair the installation or PATH
If neither node nor npm is visible, repair or reinstall Node.js using the installation method appropriate for your operating system. If Node works but npm does not, inspect the installation path and avoid adding random directories to PATH.
Still seeing the error?
Compare node --version with the npm path result. If multiple Node installations exist, remove the ambiguity before making more PATH changes. Version managers can also change which installation the current shell sees.
Still stuck? Ask the community
Share your operating system, software version, exact error text, and which fix you already tried. Another reader may have seen the same setup.
Loading community discussion…
Comments could not load here. Open ErrorHarbor Discussions on GitHub →