简体   繁体   中英

npm install does not seem to work in my case

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM