10

Hi guys I'm trying to publish my angular library in npm, but when I login I get this:

npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to http://registry.npmjs.org/-/user/org.couchdb.user:belzee10 failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:80
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\belzee\AppData\Roaming\npm-cache\_logs\2018-01-08T16_03_35_050Z-debug.log

versions

node: 8.9.3
npm: 5.5.1

I am behind an authenticated proxy and I have already configured: proxy and https-proxy

npm config set proxy http: // Username: Pa55w0rd @ proxyhostname: port
npm config set https-proxy http: // Username: Pa55w0rd @ proxyhostname: port

Thank you for your attention

Martin Brisiak
  • 3,872
  • 12
  • 37
  • 51
Ivan Perez Abreu
  • 109
  • 1
  • 1
  • 6

11 Answers11

12
npm config rm proxy
npm config rm https-proxy

Use the above commands and restart the system. It worked for me.

Pavan
  • 543
  • 4
  • 16
6

I had this problem in a WSL1 Linux container on a Windows 10 host in a corporate network.

Adding a new nameserver to the top of /etc/resolv.conf as either 9.9.9.9 or 1.1.1.1 fixed the issue.

Stuart Cardall
  • 2,099
  • 24
  • 18
4

This drove me crazy for hours and I didn't even know what I did to make it work. But the last thing I tried was:

In cmd typed ping registry.npmjs.org. Error couldn't find the host

Open hosts file through this: https://support.rackspace.com/how-to/modify-your-hosts-file/

Added 151.101.72.162 registry.npmjs.org to a new line. Save.

Tried installing a package, still didn't work

But I randomly tried to ping registry.npmjs.org again, and it worked!

Tried installing a package again, still didn't work.

Removed the 151.101.72.162 registry.npmjs.org and saved again. Practically reverting the last edit.

Tried installing and it's working now. Why???? I have no idea. For all I know there's a minor deity inside my laptop and I randomly appeased it somehow...

Irun S
  • 51
  • 4
1

Try to connect to some other network.

This error resemble some issue with network. I was trying to install a lib from NPM on windows but getting this error. This worked for me. Maybe it might help you too.

abhay tripathi
  • 3,547
  • 4
  • 20
  • 25
1

The following github link resolved the issue for me ->

https://github.com/StefanScherer/dockerfiles-windows/issues/270#issuecomment-382229052

create the file /etc/docker/daemon.json

and insert:

{
    "dns": ["10.0.0.2", "8.8.8.8"]
}

and then restarting pc

Aniruddha
  • 50
  • 2
  • 9
1

I fixed this issue by simply adding nameserver into the netplan script. This worked for me without any issue.

# This is the network config written by 'subiquity'
network:
  ethernets:
    enp1s0:
      dhcp4: true
    enp2s0:
     addresses:
        - 192.168.0.241/24
     routes:
        - to: default
          via: 192.168.0.12
     nameservers:
         addresses: [8.8.8.8, 8.8.4.4]
  version: 2
Tyler2P
  • 2,324
  • 26
  • 22
  • 31
0

First run npm i npm@latest and check error is coming again or not. if it is Try to resolve your proxy settings

For Linux(ubuntu) https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-configure-proxy-on-ubuntu-18-04/

For windows https://www.howtogeek.com/tips/how-to-set-your-proxy-settings-in-windows-8.1/

0
  1. Changed the registry as https://registry.npmjs.org/ in .npmrc file.

In terminal:

  1. npm config rm proxy
  2. npm config rm https-proxy
  3. Restarted the system. npm i worked :-)
st.huber
  • 1,481
  • 2
  • 24
  • 45
0

in my case, there must have been network instability, I deactivated then reactivated my internet connection, it works now!

Sacha Durand
  • 473
  • 1
  • 5
  • 11
-1

That error means a domain name resolution error in Node. I'm not sure what exactly could be your issue here, but https://www.codingdefined.com/2015/06/nodejs-error-errno-eaiagain.html has some good info. This error is definitely due to the proxy you have set up. I had a similar issue earlier, and disabling the proxy worked for me.

ameyaraje
  • 157
  • 4
  • 16
-1

I had the same problem you can check if you opening a session that connecting database, you can try disabling any sessions on the database and try again using npm i filepond