Search code examples
angular-cliangular-cli-v9

Cannot install @angular/[email protected] after install nodejs


I've tried to install @angular/[email protected] (npm install -g @angular/cli)

Then the following error message appeared:

These solutions I've tried but not work:

  • uninstall nodejs, delete all nodejs files related it and trying install nodejs versions(8,10,12).
  • uninstall angular(npm uninstall -g @angular/cli)
  • npm install --save-dev @angular-devkit/build-angular
  • npm cache clean --force
  • npm install -g @angular/cli --timeout=60000
  • npm config set registry http://registry.npmjs.org/

    Tip:the problem appeared when I tried update angular 8 to angular 9.

enter image description here

enter image description here


Solution

  • After many days I installed Angular 9 by this steps:

    • Open Windows PowerShell as admin
    • npm install npm@latest -g
    • npm cache clean --force
    • npm install -g @angular/cli

    and I've stopped Windows defender & Firewall

    enter image description here