NPM错误!对https://registry.npmjs.org/ngx-pagination的请求失败,原因:getaddrinfoEAI_Again注册.npmjs.org注册.npmjs.org:443 [英] npm ERR! request to https://registry.npmjs.org/ngx-pagination failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
问题描述
安装任何NPM程序包时,每次都收到相同的错误。
尝试删除并设置代理,但不起作用。
tabish@appventurez:~/Documents/projects/InstaCEI/InstaCEI_Website$sudo npm I NGX-分页--保存 NPM错误!代码EAI_再一次 NPM错误!再次出错EAI_ NPM错误!请求https://registry.npmjs.org/ngx-pagination失败,原因:getaddrinfo EAI_Again registry.npmjs.org registry.npmjs.org:443
NPM错误!可以在以下位置找到此运行的完整日志: Npm错误!/home/tabish/.npm/_logs/2019-06-19T11_27_35_023Z-debug.log
tabish@appventurez:~/Documents/projects/InstaCEI/InstaCEI_Website$sudo npm I NGX-分页--保存 NPM错误!代码EAI_再一次 NPM错误!再次出错EAI_ NPM错误!请求https://registry.npmjs.org/ngx-pagination失败,原因:getaddrinfo EAI_Again registry.npmjs.org registry.npmjs.org:443
NPM错误!可以在以下位置找到此运行的完整日志: Npm错误!/home/tabish/.npm/_logs/2019-06-19T11_27_35_023Z-debug.log
推荐答案
一个原因与您的IP地址设置有关。
如果是ubuntu,请选中ip addr
、ping
和netplan
。
在我的示例中,我设置了ubuntu(18.04)VM的静态IP,但我忘记了DNS。 然后我得到了与您完全相同的错误。
我通过更改文件/etc/netplan/50-cloud-init.yaml
来解决此问题,如下所示:
# 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
这篇关于NPM错误!对https://registry.npmjs.org/ngx-pagination的请求失败,原因:getaddrinfoEAI_Again注册.npmjs.org注册.npmjs.org:443的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!