How to Fix npm Global Command Not Found Error on Windows
A developer encountered a 'command not found' error on Windows after successfully installing a global npm package, markdown-it-cli. Investigation revealed that the npm global bin directory (C:\Users\AppData\Roaming\npm) was absent from the system's PATH environment variable, preventing Windows from locating the executable. The fix involved manually adding %AppData%\npm to the User PATH variable via system settings. Importantly, the change only took effect after closing all existing terminal windows and opening a fresh one, since running terminals retain the PATH snapshot from their launch time. The key diagnostic steps are running npm root -g to find the install location and echo %PATH% to verify whether that directory is listed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in