1
C:\Users\ZOYA ZEE>npm install -g @angular/cli@latest
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/@angular%2fcli failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ZOYA ZEE\AppData\Roaming\npm-cache\_logs\2020-07-20T12_09_19_129Z-debug.log

C:\Users\ZOYA ZEE>npm install -g @angular/cli@latest
Thirumal
  • 8,280
  • 11
  • 53
  • 103

3 Answers3

0

I have 2 idea:

  1. Try to run npm install -g @angular/cli
  2. In case you will have error: did you run it from power shell or command line? Cause I had a problem with "ng new app" from power shell, but in a command-line it was correct
0

Dou you have problems with your internet connection?

From your error, which says

ERR! request to https://registry.npmjs.org/@angular%2fcli failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org

It seems as though internet connection is low, or restricted.

Try looking at this answer to solve your problem.

BatshevaRich
  • 550
  • 7
  • 19
0

First, of all check, your internet connection is working or not. And if there is no problem with the internet then use below command

$ npm cache verify

$ npm cache clean --force

and then try again.

If you still get the error then use the yarn package manager. Install yarn by running this

$ npm install -g yarn

and then configure angular cli to use the yarn package manager, by running this command

$ ng config -g cli.packageManager yarn

Ashad Nasim
  • 2,511
  • 21
  • 37