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
            Asked
            
        
        
            Active
            
        
            Viewed 632 times
        
    1
            
            
        
        Thirumal
        
- 8,280
 - 11
 - 53
 - 103
 
        user13963147
        
- 11
 - 1
 
- 
                    Dou you have problems with your internet connection? – BatshevaRich Jul 20 '20 at 12:19
 - 
                    Did you just install Node.JS? If so, then it's necessary to restart your computer. – Ruben Szekér Jul 20 '20 at 12:28
 - 
                    yes i have installed node js and also npm – user13963147 Jul 21 '20 at 13:21
 
3 Answers
0
            
            
        I have 2 idea:
- Try to run npm install -g @angular/cli
 - 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
 
        Vlad Pavlik
        
- 1
 - 1
 
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