1

While installing any npm package, I am getting the same error every time.

Tried to remove and set proxy but it didn't work.

tabish@appventurez:~/Documents/projects/InstaCEI/InstaCEI_Website$ sudo npm i ngx-pagination --save npm ERR! code EAI_AGAIN npm ERR! errno EAI_AGAIN npm ERR! request to https://registry.npmjs.org/ngx-pagination failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443

npm ERR! A complete log of this run can be found in: npm ERR! /home/tabish/.npm/_logs/2019-06-19T11_27_35_023Z-debug.log

tabish@appventurez:~/Documents/projects/InstaCEI/InstaCEI_Website$ sudo npm i ngx-pagination --save npm ERR! code EAI_AGAIN npm ERR! errno EAI_AGAIN npm ERR! request to https://registry.npmjs.org/ngx-pagination failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443

npm ERR! A complete log of this run can be found in: npm ERR! /home/tabish/.npm/_logs/2019-06-19T11_27_35_023Z-debug.log

tabish ahmed
  • 11
  • 1
  • 7

1 Answers1

1

One reason is about your IP address setup. Check ip addr, ping, and netplan if ubuntu.

In my example, I setup a static IP of an ubuntu (18.04) VM, but I forgot the DNS. Then I got the exactly same error as you.

I fix this problem by changing the file /etc/netplan/50-cloud-init.yaml as below:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
         ens33:
                 addresses: [192.168.233.132/24]
                 dhcp4: no
                 gateway4: 192.168.233.2
                 optional: true
                 nameservers:
                         addresses: [223.5.5.5, 8.8.8.8]
    version: 2
AvantContra
  • 371
  • 1
  • 3
  • 10
  • 1
    I am using Ubuntu 18.04 natively and I have no problem pinging/curling https://registry.npmjs.org and I can even download the package that returns this error but still npm install fails, was it the same for you? – AVarf May 04 '20 at 13:40