npm install angular/cli error

35,140

Solution 1

If you are getting the below message:

npm ERR! network 'proxy' config is set properly. See: 'npm help config'

you need to set proxy

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

and

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

give your proxy ip address and port number(4digits)

if you dont want to use proxy remove it using below command

$ npm config rm proxy   
$ npm config rm https-proxy

To check the current proxy

$ npm config get proxy

Solution 2

Remove the proxies by running the following commands.

npm config rm proxy

npm config rm https-proxy

It should work now.

Solution 3

try

npm config set proxy http://USERNAME:PASS@IP_Address:PORT_NO/
  • don't delete http://
  • USERNAME is your name in your physique machine
  • PASS is your password in your physical machine

After that try to install your packages for example: npm install -g @angular/cli

Share:
35,140
sahil
Author by

sahil

Updated on May 07, 2021

Comments

  • sahil
    sahil almost 3 years

    node -v 8 and npm -v 5. Trying to install angular/cli globally from yesterday. Facing new error everytime.

    Vipins-Air:~ vipingupta$ sudo npm install -g @angular/cli npm ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! network request to http://registry.npmjs.org/@angular%2fcli failed, reason: connect ETIMEDOUT 74.122.238.10:8080 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! /Users/vipingupta/C:Devnodejsnpm-cache/_logs/2017-06-07T06_37_13_337Z-debug.log

  • sahil
    sahil almost 7 years
    facing issue same again:- I run sudo npm cache clean --force, sudo npm uninstall -g @angular/cli, sudo npm install -g @angular/cli
  • suraj garla
    suraj garla about 5 years
    I have tried using the npm config set proxy. But I was still facing the issue. Then I opened the command line in the project folder and use set http_proxy=_proxy_name_. This worked for me