0

I downloaded node.js and when I run CLI command npm install -g @angular/cli I get these errors:

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.npmjs.org/@angular%2fcli failed, reason: getaddrinfo ENOTFOUND proxy.example.com
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Omar Abdelkefi\AppData\Roaming\npm-cache\_logs\2020-03-08T13_10_01_192Z-debug.log

Please any help

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • maybe you have to set the proxy settings. It is explained here: https://stackoverflow.com/questions/7559648/is-there-a-way-to-make-npm-install-the-command-to-work-behind-proxy – Ado Mar 08 '20 at 13:24

1 Answers1

0

If there is a such error ...

npm ERR! network 'proxy' config is set properly

then you have to set the proxy properly

$ npm config set proxy http://XXX.XXX.XXX.XXX:XXXX

plus

$ npm config set https-proxy http://XXX.XXX.XXX.XXX:XXXX

You can check the current proxy via :

$ npm config get proxy

If there is a need to delete proxy , then go ahead and do : (Try below first)

$ npm config rm proxy   
$ npm config rm https-proxy
Afelaia Timur
  • 51
  • 1
  • 4