ng is not recognized as an internal or external command [SOLVED]

Recently i was facing a trouble during installing angular-cli. whenever i install angular-cli and run command 'ng -v' or any other ng command it says 'ng is not recognized as an internal or external command'. I google it and didn't found any serious solution. So i tried myself and got the solution.

Why this happens?

Simple answer is that whenever you install angular-cli for some reasons the address of NPM in system variables got deleted or edited.

Solution

I tried everything from google but nothing works for me. But when i save the NPM address in system variables suddenly all ng commands started working for me.

what my NPM address looks like 
"C:\Users\Inam Ul Huq\AppData\Roaming\npm" without double quotes.
After doing this i just restarted my command line and executed 'ng-v' command. and got this result.

ng is not recognized as an internal or external command [SOLVED]

this is how i saved my system variable.you can ask me more in comments.

ng is not recognized as an internal or external command [SOLVED]


I hope this will help you :) if you are facing any problem please let me know. 


Inambe

Phasellus facilisis convallis metus, ut imperdiet augue auctor nec. Duis at velit id augue lobortis porta. Sed varius, enim accumsan aliquam tincidunt, tortor urna vulputate quam, eget finibus urna est in augue.

3 comments:

  1. Thnx alot I searched for hours and this helped to save my day

    ReplyDelete
  2. Thank you so much man..It's one and half day & I didn't get but once I saw your solution it worked...tqsm

    ReplyDelete