angularwindows-10angular-cliangular17angular19

Upgrading Angular-CLI from Angular 17 to Angular 19 causing major errors on my system -


I was running nG version 17.3 on my Win10 system. I wanted to upgrade my Angular CLI to latest version 19. So I did the following steps-

  1. npm uninstall -g @angular/cli
    
  2. npm install -g @angular/cli@latest
    

Now, if I try to run ng version on my command prompt, it gives the following message

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

My whole system is screwed up. How do I get Angular up and running again with the latest CLI installed?


Solution

  • After running npm uninstall -g @angular/cli which uninstalls the Angular CLI, you would need to run npm install -g @angular/cli to have the Angular CLI installed again and be able to use the commands starting with ng.

    @WillHelpYou is right - when changing Node.js versions you typically need to also run npm install -g @angular/cli since when you change your Node.js version (especially using tools like nvm or manually reinstalling Node.js), you often lose access to globally installed packages like the Angular CLI.