The term 'ng' is not recognized as the name of a cmdlet

The first path in the path variable needs to be the NPM path. Opening the Node.js command prompt I found that the ng command worked there. I dug into the shortcut and found that it references a command to ensure the first Path variable is NPM. To Fix:

  1. Right Clicked on My Computer (windows)
  2. Selected Advanced System Settings
  3. Clicked "Environment Variables"
  4. Under "Path" variable, made the FIRST value listed %AppData%\npm

Once I did that I was able to close powershell and reopen and all worked.


First setup Node.js, then go to your project folder with the command prompt such as D:\project and then run this command:

npm install -g @angular/cli

Now run ng command. This work for me.


In the "Environment Variables"

In the "System variables" section

In the "Path" variable and before "C:\Program Files (x86)\nodejs\" add => "%AppData%\npm"