0

I've tried to install @angular/cli@9.1.8 (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

Mohamad Alhamid
  • 346
  • 4
  • 15

2 Answers2

0

Your npm install trying to access packages from http, it should use https url. Follow these steps :-

  1. Run

    npm config set registry https://registry.npmjs.org/

  2. Run npm cache clean --force

  3. Run npm i -g @angular/cli@latest

Aakash Garg
  • 10,649
  • 2
  • 7
  • 25
0

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

Mohamad Alhamid
  • 346
  • 4
  • 15