0
votes

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

2
are you behind a company proxy?Aakash Garg
No, But the problem appeared when I tried update angular 8 to angular 9Mohamad Alhamid
do one thing, run npm cache clean --force, after than run npm i -g @angular/cli@latestAakash Garg
Not work, Same messageMohamad Alhamid
instead of http use https in registry url.Aakash Garg

2 Answers

0
votes

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

0
votes

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