'ng' is not recognized as an internal or external command, operable program or batch file

前端 未结 19 1531
轻奢々
轻奢々 2021-01-31 01:31

I tried running npm install -g angular-cli

I also tried adding it to the Enviorment Variables under PATH: (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node

19条回答
  •  误落风尘
    2021-01-31 02:10

    make sure environment variables are set properly.

    control panel-> system->advanced system settings-> select advanced Tab->
    click on environment variables
    

    and make sure in the path below line is available

    `C:\Users\username\AppData\Roaming\npm`   
    

    here username will get changed based on the user

    .

    still if its not working yourenvironment variables are not getting reflected so please restart your machine it will work fine

    if still you are facing issue your angular cli is not installed properly

    please run below commands for reinstalling

       npm uninstall -g @angular/cli
    
        npm cache clean    or   npm cache clean  --force
    
        npm install -g @angular/cli@latest
    

提交回复
热议问题