npm ERR! network getaddrinfo ENOTFOUND

前端 未结 17 887
傲寒
傲寒 2020-12-02 18:12

I am getting npm ERR! network getaddrinfo ENOTFOUND error while trying to install any package using NPM. I know there are numerous threads on the same issue but

相关标签:
17条回答
  • 2020-12-02 18:51

    strict-ssl=false

    proxy = http://ip_address_of_proxy:8088 https-proxy = https://ip_address_of_proxy:8088
    registry = http://registry.npmjs.org/

    0 讨论(0)
  • 2020-12-02 18:52

    for some reason my error kept pointing to the "proxy" property in the config file. Which was misleading. During my troubleshooting I was trying different values for the proxy and https-proxy properties, but would only get the error stating to make sure the proxy config was set properly, and pointing to an older value.

    Using, NPM CONFIG LS -L command lists all the properties and values in the config file. I was then able to see the value in question was matching the https-proxy, therefore using the https-proxy. So I changed the proxy (my company uses different ones) and then it worked. figured I would add this, as with these subtle confusing errors, every perspective on it helps.

    0 讨论(0)
  • 2020-12-02 18:53

    does your proxy require you to authenticate? because if it does, you might want you configure your proxy like this.

    placeholder names. username is a placeholder for your actual username. password is a placeholder for your actual password. proxy.company.com is a placeholder for your actualy proxy *port" is your actualy port the proxy goes through. its usualy 8080

    npm config set proxy "http://username:password@proxy.company.com:port"
    npm config set https-proxy "http://username:password@proxy.company.com:port"
    
    0 讨论(0)
  • 2020-12-02 18:54

    Step 1: Set the proxy npm set proxy http://username:password@companyProxy:8080

    npm set https-proxy http://username:password@companyProxy:8080

    npm config set strict-ssl false -g

    NOTES: No special characters in password except @ allowed.

    0 讨论(0)
  • 2020-12-02 18:56

    Instead of setting the proxy usingnpm config set http_proxy=http://address:8080 go to ~/.npmrc and remove the proxy config. This resolved my issue.

    0 讨论(0)
提交回复
热议问题