% npm
zsh: command not found: npm
If you just installed npm - "node package manager" on your Mac or Unix-Like Operating system and you get "command not found" when you run any npm command on your zsh shell, then the most common reason is that you missed setting the PATH for the npm binary.
Fix: If npm was installed via homebrew.
- Open Terminal App.
- Now on the ZSH shell prompt run the below command,
For Intel Chip:export PATH=/usr/local/share/npm/bin:$PATH
For M1/M2 ARM Chip:export PATH=/opt/homebrew/bin/npm/bin:$PATH
- Refresh your zsh shell by either just typing zsh on the prompt or,
source ~/.zshrc
- Now try the npm command,
% npm --version 9.6.7

-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to zsh,
- [fix] zsh: illegal hardware instruction python TensorFlow M1/M2 Mac
- macOS Ventura 13: The default interactive shell is now zsh
- Fix: cd: string not in pwd
- How to reload Zsh .zshrc Profile
- Resolve - zsh: command not found: code
- Ubuntu zsh: command not found: nano
- Fix: zsh: command not found: mysql (Mac XAMPP)
- Setting up Zsh Syntax Highlighting
- Fix zsh: permission denied: script.sh
- Fix - zsh: command not found: conda [macOS]
- zsh: command not found [fix] macOS
- ZSH: exec format error eclipse M1/M2 Mac
- Fix for zsh: command not found: brew
- Fix: zsh: command not found: npm after installation (Node.js)
- How to reload zsh shell profile file?
- How to Add New Entry to ZSH PATH
- How to make ZSH as the default shell on Ubuntu
- How to fix: zsh: command not found: jupyter
- How to clear ZSH history of commands executed on Mac Terminal
- Fix - zsh: command not found: pip
- Fix - cd: no such file or directory: .zshrc
- Add Syntax Highlighting in Zsh Shell
- Fix: ZSH: cd: too many arguments (macOS)
More Posts:
- How to check file permissions for your file using Linux/Unix/macOS Terminal Command - Linux
- Download a SSL Certificate from a URL in Terminal - Bash
- Eclipse like Auto Import Shortcut in Intelij IDE Android Studio - Android-Studio
- How to delete a file using Python code example - Python
- SharePoint 2010 August 2015 Update KB3055049 - Duplicate Document ID issue bug fixed - SharePoint
- Google Chrome Update failed (error: 12) - Chrome
- SharePoint installation - Appfabric installation failed because installer MSI returned with error code:1603 - SharePoint
- Where is AWS Config and Credential files located on Mac - AWS