Error getaddrinfo enotfound steamcommunity com

test: Error: getaddrinfo ENOTFOUND localhost #44003 Comments Version Platform Subsystem What steps will reproduce the bug? Currently the failures are visible in the current build log, How often does it reproduce? Is there a required condition? What is the expected behavior? What do you see instead? Additional information and resolv.conf doesn’t exist. All other […]

Содержание

  1. test: Error: getaddrinfo ENOTFOUND localhost #44003
  2. Comments
  3. Version
  4. Platform
  5. Subsystem
  6. What steps will reproduce the bug?
  7. How often does it reproduce? Is there a required condition?
  8. What is the expected behavior?
  9. What do you see instead?
  10. Additional information
  11. HTTP-запрос nodejs getaddrinfo Ошибка ENOTFOUND
  12. Error: getaddrinfo ENOTFOUND when trying to connect to a server #745
  13. Comments
  14. getaddrinfo ENOTFOUND marketplace.visualstudio.com marketplace.visualstudio.com:443 #5816
  15. Comments
  16. +33(0)954 909 111
  17. +33(0)954 909 111

test: Error: getaddrinfo ENOTFOUND localhost #44003

Version

Platform

Subsystem

What steps will reproduce the bug?

Currently the failures are visible in the current build log,

How often does it reproduce? Is there a required condition?

What is the expected behavior?

What do you see instead?

Additional information

and resolv.conf doesn’t exist. All other test cases that use localhost are passing, as expected.

The text was updated successfully, but these errors were encountered:

curious what you see when doing strace . On Ubuntu I see the following:

I get this error sometimes on my pc, but not always.

ENOTFOUND is a synthetic error that node fabricates when it doesn’t get an answer back from getaddrinfo(3), it’s not a real operating system-level error. Reasons include running out of file descriptors in libc (not visible to node), not getting back a response from the DNS server, etc. It’s basically a catch-all.

In this case, there is no DNS server and it works with other tests.

strace shows nothing. This is only a problem since about 18.2.0 and not before and not in any other released line. And I only see it in a VM build environment and not in a chroot (at least it disappeared there) which is very strange.

I will try to bisect the issue.

You mean v18.1.0 works? There are no changes between the two that seem like likely culprits. I’m interested to see what bisect turns up.

So, the bisect ended up on 70b516e which is #43054 . Looking at the pull request, it kind of makes sense this is the one as the tests in question are explicitly skipped on some platforms.

The test is reproducible every time on openSUSE:Tumbleweed build VM. I can’t reproduce it outside of it on a workstation, but in the VM with no networking connections and only a hosts file to resolve localhost to ipv6 and ipv4, it reproduces every time.

I will try to look more closely what is actually failing here.

This was introduced in 18.4.0. I mistyped earlier the versions. 18.2.0 still passed

Is there no network interface at all, no loopback ?

So, I’ve learned something about debugging node over last few days 🙂 But I did find the problem.

The problem is that family is set to a string, which causes hints to be set to 32 which means AI_ADDRCONFIG and then address resolution fails.

On a network connected device, this passes.

Why? We can look at the manpage for getaddrinfo

If hints.ai_flags includes the AI_ADDRCONFIG flag, then IPv4 addresses are returned in the list pointed to by res only if the local system has at least one IPv4 address configured, and IPv6 addresses are returned only if the local system has at least one IPv6 address configured. The loopback address is not considered for this case as valid as a configured address. This flag is useful on, for example, IPv4-only systems, to ensure that getaddrinfo() does not return IPv6 socket addresses that would always fail in connect(2) or bind(2).

This is why these tests fail every time when you have a loopback interface as the only network interface active. They will pass if you have other network interfaces active.

Источник

HTTP-запрос nodejs getaddrinfo Ошибка ENOTFOUND

Я пробовал много способов сделать http-запрос, но всегда получал ошибку getaddrinfo ENOTFOUND .

Среда: nodejs Поставщик: Функции Firebase

Метод 1 — запрос npm:

Метод 2 — npm jquery:

Метод 3 — npm https:

Независимо от того, каким образом консоль всегда показывает ошибку getaddrinfo ENOTFOUND :443 .

У меня действительно заканчивается идея, посоветуйте, пожалуйста.

1) Я замаскировал URL-адрес и пароль из запроса о конфиденциальности и безопасности.

2) Я внедрил промежуточное ПО для проверки авторизации. Поэтому, если открыть URL-адрес в браузере, он скажет «неавторизованный», но если я использую Postman для отправки запроса GET с заголовком «Authorization»: «Basic password» , он покажет результат API, как и ожидалось.

3) код API и код HTTP-запроса находятся на одном сервере / проекте функций firebase.

4) nodejs импортировал следующий модуль, не уверен, что это вызывает какой-то конфликт: firebase-functions , firebase-admin , jsdom , request , https , express , body-parser , cors , jquery , nodemailer

Кажется, что целевой URL не имеет https , поэтому он выдает ошибку :443 , пожалуйста, убедитесь, что URL имеет https

Согласно документации https , похоже, что Method 3 — npm https не позволяет помещать «https» в url . Но URL-адрес, который я хочу вызвать, определенно использует https, потому что его облачная функция Google.

добавьте family: 4 в параметры для Method 3 и попробуйте с модулем https и http .

также вы можете сослаться на этот URL: https://github.com/nodejs/node/issues/5436#issuecomment-3730‌​02246

Если вы просто откроете URL-адрес https://us-central1-

.cloudfunctions.net/api/wakeUp в браузере, что он сделает?

Frank van Puffelen

@FrankvanPuffelen Я внедрил промежуточное ПО для проверки авторизации. Поэтому, если открыть URL-адрес в браузере, он скажет «неавторизованный», но если я использую Postman для отправки запроса GET с заголовком «Authorization»: «Basic password» , он покажет результат API, как и ожидалось.

@FrankvanPuffelen Дополнительная информация, код API и код HTTP-запроса находятся на одном сервере / проекте функций firebase.

Источник

Error: getaddrinfo ENOTFOUND when trying to connect to a server #745

I’m having a big issue with connecting to a FTP server with remote-ftp.

It looks like this:
‘Remote FTP: Connection failed
Error: getaddrinfo ENOTFOUND ftp://ftp.lumeaadidasilor.ro ftp://ftp.lumeaadidasilor.ro:21″. I couln’t find anything related to this anywhere.

It’s only happening to one hosting provider ( I tried two different shared accounts from them, same issue ).
I tried discussing it with them, but not much help. They said «Eliminate the TLS from the configuration and try again». I don’t know how I could do that or if that’s the issue.

It’s definitely some particular server configuration they have and Atom can’t get around. I didn’t have that issue anywhere else (I’ve worked with Atom on tens of servers). Also, only Atom has a problem on this provider. Connection works with other ftp clients ( FileZilla, WinSCP, Dreamweaver, web ftp etc).

If you have the time, You canreplicate the issue with this temp FTP I created.
host: ftp.lumeaadidasilor.ro
u: testftp@lumeaadidasilor.ro
p:TestingPassword123!

I hope to get this fixed, otherwise I’m forced to work with something else than Atom ( which would really suck) or ditch the host altogether (would suck less, but still quite inconvenient).

The FTP config file looks like this:

<
«protocol»: «ftp»,
«host»: «ftp://ftp.lumeaadidasilor.ro»,
«port»: 21,
«user»: «testftp@lumeaadidasilor.ro»,
«pass»: «TestingPassword123!»,
«promptForPass»: false,
«remote»: «/»,
«local»: «»,
«secure»: false,
«secureOptions»: null,
«connTimeout»: 10000,
«pasvTimeout»: 10000,
«keepalive»: 10000,
«watch»: [],
«watchTimeout»: 500
>

Thank you very much!

The text was updated successfully, but these errors were encountered:

Источник

getaddrinfo ENOTFOUND marketplace.visualstudio.com marketplace.visualstudio.com:443 #5816

Hello,
I am unable to load the library nor get any info about installed plugin.
I am behind a proxy driven by ntlm @localhost:7124

  • VSCode Version: 0.10.11
  • OS Version: Windows 7

All my app are fine except VS !!

Steps to Reproduce:

  1. CTr+ Shift P
  2. ext install
    get following error message :

«getaddrinfo ENOTFOUND marketplace.visualstudio.com marketplace.visualstudio.com:443»

< «strict-ssl»:false,
«http.proxyStrictSSL»: false,
«http.proxy»: «localhost:7124»,
«https.proxy»: «localhost:7124»,
«git.enabled»: true,
«git.path»: «c:Applicationstoolsgitbingit.exe»
>

How to solve this issue ? g

The text was updated successfully, but these errors were encountered:

@marcpoggi Set http.proxy to https://localhost:7124 .

don’t work .
same message

I tried this
< «strict-ssl»:false,
«http.proxyStrictSSL»: false,
«http.proxy»: «htttps://localhost:7124»,
«https.proxy»: «https://localhost:7124»,
«git.enabled»: true,
«git.path»: «c:Applicationstoolsgitbingit.exe»
>
and this
< «strict-ssl»:false,
«http.proxyStrictSSL»: false,
«http.proxy»: «htttp://localhost:7124»,
«https.proxy»: «https://localhost:7124»,
«git.enabled»: true,
«git.path»: «c:Applicationstoolsgitbingit.exe»
>

Your http.proxy value has 3 t characters: htttps:// . Make sure it only has 2: http:// .

Also, the configuration setting https.proxy does not exist, so you can remove it; only http.proxy exists.

I already got it , but not still working

Not Working
I tried
< «strict-ssl»:false,
«http.proxyStrictSSL»: false,
«http.proxy»: «http://localhost:7124»,
«git.enabled»: true,
«git.path»: «c:Applicationstoolsgitbingit.exe»
>

Also make sure you restart Code every time you change them.

This is very unfortunate. We’re looking into a way to detect your system’s proxy settings and using them accordingly.

Yes I restarted each time.
I am not fortunate , you’re right.

Anyway to workaround this problem ?

Marc Poggi
+33(0)6 84 085 086

FEELTEST
11 Avenue Bataillon Carmagnole Liberté
69120 Vaulx en Velin

+33(0)954 909 111

2016-04-27 10:01 GMT+02:00 João Moreno notifications@github.com:

Also make sure you restart Code every time you change them.

This is very unfortunate. We’re looking into a way to detect your system’s
proxy settings and using them accordingly.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#5816 (comment)

Not as far as I know.

Can you give me the output of the following commands?

$ node -p «require(‘dns’).getServers()»
[ ‘10.171.108.2’,
‘10.171.34.57’,
‘10.171.30.4’,
‘fec0:0:0:ffff::1’ ]

second one
node -e «require(‘dns’).resolve4(‘marketplace.visualstudio.com ‘,
function(err, result))»

< [Error: queryA ENOTFOUND marketplace.visualstudio.com ]
code: ‘ENOTFOUND’,
errno: ‘ENOTFOUND’,
syscall: ‘queryA’,
hostname: ‘marketplace.visualstudio.com ‘ > undefined

and final one !!
node -e «require(‘dns’).lookup(‘marketplace.visualstudio.com ‘,
function(err, result))»

< [Error: getaddrinfo ENOTFOUND marketplace.visualstudio.com ]
code: ‘ENOTFOUND’,
errno: ‘ENOTFOUND’,
syscall: ‘getaddrinfo’,
hostname: ‘marketplace.visualstudio.com ‘ > undefined

Marc Poggi
+33(0)6 84 085 086

FEELTEST
11 Avenue Bataillon Carmagnole Liberté
69120 Vaulx en Velin

+33(0)954 909 111

2016-04-27 12:25 GMT+02:00 João Moreno notifications@github.com:

Can you give me the output of the following commands?

node -p «require(‘dns’).getServers()»
node -e «require(‘dns’).resolve4(‘marketplace.visualstudio.com ‘, (err, result) => console.log(err, result))»
node -e «require(‘dns’).lookup(‘marketplace.visualstudio.com ‘, (err, result) => console.log(err, result))»


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#5816 (comment)

Источник

Comments

@T94T

@mscdex
mscdex

added

http

Issues or PRs related to the http subsystem.

dns

Issues and PRs related to the dns subsystem.

labels

Feb 25, 2016

@sQVe
sQVe

mentioned this issue

Jan 10, 2020


1 similar comment

martinhauke

added a commit
to martinhauke/rattl
that referenced
this issue

Oct 19, 2022

@martinhauke

Apparently it can happen that requests within node will randomly switch between ipv6 and ipv4 unless one of them is explicitly specified. I have configured ipv4 for now and that seems to fix it.

See also:

* axios/axios#444
* nodejs/node#5436

При использовании Node.js, чтобы попытаться получить HTML-содержимое следующей веб-страницы:

eternagame.wikia.com/wiki/EteRNA_Dictionary

Я получаю следующую ошибку:

events.js:72
    throw er; // Unhandled 'error' event
          ^
Error: getaddrinfo ENOTFOUND
    at errnoException (dns.js:37:11)
    at Object.onanswer [as oncomplete] (dns.js:124:16)

Я уже искал эту ошибку в stackoverflow и понял, что это потому, что node.js не может найти сервер из DNS (я думаю). Однако я не уверен, почему это могло быть так, поскольку мой код отлично работает на www.google.com.

Вот мой код (практически скопированный и вставленный из очень похожего вопроса, за исключением изменения хоста):

var http = require("http");

var options = {
    host: 'eternagame.wikia.com/wiki/EteRNA_Dictionary'
};

http.get(options, function (http_res) {
    // initialize the container for our data
    var data = "";

    // this event fires many times, each time collecting another piece of the response
    http_res.on("data", function (chunk) {
        // append this chunk to our growing `data` var
        data += chunk;
    });

    // this event fires *one* time, after all the `data` events/chunks have been gathered
    http_res.on("end", function () {
        // you can use res.send instead of console.log to output via express
        console.log(data);
    });
});

Вот источник, из которого я скопировал и вставил: Как сделать веб-сервис звонки в Expressjs?

Я не использую никаких модулей с node.js.

Спасибо за прочтение.

19 ответов

Лучший ответ

В документации модуля Node.js HTTP: http: // nodejs.org/api/http.html#http_http_request_options_callback

Вы можете либо вызвать http.get('http://eternagame.wikia.com/wiki/EteRNA_Dictionary', callback), затем URL-адрес будет проанализирован с помощью url.parse(); или позвоните http.get(options, callback), где options

{
  host: 'eternagame.wikia.com',
  port: 8080,
  path: '/wiki/EteRNA_Dictionary'
}

Обновить

Как указано в комментарии @EnchanterIO, поле port также является отдельным параметром; и протокол http:// не следует включать в поле host. Другие ответы также рекомендуют использовать модуль https, если требуется SSL.


363

felixwong8
14 Авг 2018 в 22:33

Я думаю, что http делает запрос на порт 80, хотя я упомянул полный URL-адрес хоста в объекте параметров. Когда я запускаю серверное приложение с API на порту 80, которое я ранее запускал на порту 3000, оно работало. Обратите внимание, что для запуска приложения на 80-м порту вам потребуются привилегии root.

Error with the request: getaddrinfo EAI_AGAIN localhost:3000:80

Вот полный фрагмент кода

var http=require('http');

var options = {
  protocol:'http:',  
  host: 'localhost',
  port:3000,
  path: '/iso/country/Japan',
  method:'GET'
};

var callback = function(response) {
  var str = '';

  //another chunk of data has been recieved, so append it to `str`
  response.on('data', function (chunk) {
    str += chunk;
  });

  //the whole response has been recieved, so we just print it out here
  response.on('end', function () {
    console.log(str);
  });
}

var request=http.request(options, callback);

request.on('error', function(err) {
        // handle errors with the request itself
        console.error('Error with the request:', err.message);        
});

request.end();


7

Mahtab Alam
30 Май 2017 в 10:13

Обратите внимание, что эта проблема также может возникнуть, если домен, на который вы ссылаетесь, выходит из строя (например, больше не существует).


4

Mauvis Ledford
11 Авг 2015 в 21:11

Я попробовал это с помощью модуля запроса и довольно легко смог распечатать текст этой страницы. К сожалению, с теми навыками, которые у меня есть, я ничем не могу помочь.


1

mayorbyrne
17 Июл 2013 в 10:55

Я исправил эту ошибку с помощью этого

$ npm info express --verbose
# Error message: npm info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
$ nslookup registry.npmjs.org
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
registry.npmjs.org  canonical name = a.sni.fastly.net.
a.sni.fastly.net    canonical name = prod.a.sni.global.fastlylb.net.
Name:   prod.a.sni.global.fastlylb.net
Address: 151.101.32.162
$ sudo vim /etc/hosts 
# Add "151.101.32.162 registry.npmjs.org` to hosts file
$ npm info express --verbose
# Works now!

Исходный источник: https://github.com/npm/npm/issues/6686


6

eyllanesc
14 Авг 2018 в 22:36

Если вы все еще сталкиваетесь с проверкой настройки прокси-сервера, для меня это была настройка прокси, которая отсутствовала и не смогла выполнить запрос, поскольку прямые http / https заблокированы. Итак, я настроил прокси от своей организации, когда делал запрос.

npm install https-proxy-agent 
or 
npm install http-proxy-agent

const httpsProxyAgent = require('https-proxy-agent');
const agent = new httpsProxyAgent("http://yourorganzation.proxy.url:8080");
const options = {
  hostname: 'encrypted.google.com',
  port: 443,
  path: '/',
  method: 'GET',
  agent: agent
};


0

Ansar Ahmed
9 Июн 2017 в 12:19

Я решил эту проблему, удалив нежелательные символы из пароля для подключения. Например, у меня были эти символы: <##%, и это вызвало проблему (скорее всего, хеш-тег был основной причиной проблемы).


0

Shota
1 Сен 2017 в 09:49

Я получил эту ошибку при переходе из среды разработки в рабочую среду. Я был одержим размещением https:// на всех ссылках. В этом нет необходимости, поэтому для некоторых это может быть решением.


1

petur
12 Июн 2015 в 13:21

Моя проблема заключалась в том, что мы анализировали URL-адрес и генерировали http_options для http.request ();

Я использовал request_url.host, у которого уже был номер порта с доменным именем, поэтому пришлось использовать request_url.hostname.

var request_url = new URL('http://example.org:4444/path');
var http_options = {};

http_options['hostname'] = request_url.hostname;//We were using request_url.host which includes port number
http_options['port'] = request_url.port;
http_options['path'] = request_url.pathname;
http_options['method'] = 'POST';
http_options['timeout'] = 3000;
http_options['rejectUnauthorized'] = false;


0

Arjun J Gowda
8 Авг 2019 в 10:04

Попробуйте использовать IP-адрес сервера, а не имя хоста. Это сработало для меня. Надеюсь, это сработает и для вас.


1

Hemantkumar Gaikwad
6 Янв 2019 в 11:22

В моем случае ошибка была из-за использования неправильного значения хоста

  var options = {
    host: 'graph.facebook.com/v2.12/',
    path: path
  }

Должно быть

  var options = {
    host: 'graph.facebook.com',
    path: path
  }

Поэтому все, что находится после .com или .net и т. д., должно быть перемещено в значение параметра пути


2

kashlo
27 Дек 2020 в 19:27

Моя проблема заключалась в том, что мою службу DNS OS X (Mavericks) нужно было перезапустить. В Catalina и Big Sur DNS кеш можно очистить с помощью:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Старые версии macOS см. здесь< /а>.


21

vhs
9 Мар 2021 в 11:35

В параметрах HTTP-запроса переключите его на

var options = { host: 'eternagame.wikia.com', 
                path: '/wiki/EteRNA_Dictionary' };

Думаю, это решит твою проблему.


22

Russbear
17 Июл 2013 в 09:07

Если вам нужно использовать https, используйте библиотеку https

https = require('https');

// options
var options = {
    host: 'eternagame.wikia.com',
    path: '/wiki/EteRNA_Dictionary'
}

// get
https.get(options, callback);


12

Andrew
11 Авг 2016 в 02:39

Еще один распространенный источник ошибок для

Error: getaddrinfo ENOTFOUND
    at errnoException (dns.js:37:11)
    at Object.onanswer [as oncomplete] (dns.js:124:16)

Записывает протокол (https, https, …) при установке свойства host в options

  // DON'T WRITE THE `http://`
  var options = { 
    host: 'http://yoururl.com',
    path: '/path/to/resource'
  }; 


274

Jorge Bucaran
27 Мар 2017 в 22:49

  var http=require('http');
   http.get('http://eternagame.wikia.com/wiki/EteRNA_Dictionary', function(res){
        var str = '';
        console.log('Response is '+res.statusCode);

        res.on('data', function (chunk) {
               str += chunk;
         });

        res.on('end', function () {
             console.log(str);
        });

  });


11

sheshu kurnool
25 Апр 2018 в 13:21

Я избавился от http и лишней косой черты (/). Я просто использовал этот «node-test.herokuapp.com», и он сработал.


0

Uday Reddy
22 Июл 2016 в 13:29

В моем случае проблема заключалась в неправильном формате URL. У меня были двойные косые черты в URL.


0

Sterling Diaz
27 Апр 2022 в 04:42

при использовании Node.js, чтобы попытаться получить html-содержимое следующей веб-страницы:

eternagame.wikia.com/wiki/EteRNA_Dictionary

Я получаю следующую ошибку:

events.js:72
    throw er; // Unhandled 'error' event
          ^
Error: getaddrinfo ENOTFOUND
    at errnoException (dns.js:37:11)
    at Object.onanswer [as oncomplete] (dns.js:124:16)

Я уже искал эту ошибку в stackoverflow и понял, что это потому, что узел.js не может найти сервер из DNS (я думаю). Однако я не уверен, почему это так, поскольку мой код отлично работает на www.google.com.

вот мой код (практически скопированный и вставленный из очень похожего вопроса, кроме как с измененным хостом):

var http = require("http");

var options = {
    host: 'eternagame.wikia.com/wiki/EteRNA_Dictionary'
};

http.get(options, function (http_res) {
    // initialize the container for our data
    var data = "";

    // this event fires many times, each time collecting another piece of the response
    http_res.on("data", function (chunk) {
        // append this chunk to our growing `data` var
        data += chunk;
    });

    // this event fires *one* time, after all the `data` events/chunks have been gathered
    http_res.on("end", function () {
        // you can use res.send instead of console.log to output via express
        console.log(data);
    });
});

вот источник, из которого я скопировал и вставил:как сделать вызовы веб-службы в Expressjs?

Я не использую какие-либо модули с узлом.js.

Спасибо за чтение,

Vineet

16 ответов


на узел.js HTTP документация модуля:http://nodejs.org/api/http.html#http_http_request_options_callback

можно назвать http.get('http://eternagame.wikia.com/wiki/EteRNA_Dictionary', callback) URL-адрес, затем анализируется с url.parse(); или позвонить http.get(options, callback), где options is

{
  host: 'eternagame.wikia.com',
  port: 8080,
  path: '/wiki/EteRNA_Dictionary'
}

обновление

как указано в комментарии @EnchanterIO,port поле также является отдельной опцией; и протокол http:// не должно быть включено в


еще один распространенный источник ошибок

Error: getaddrinfo ENOTFOUND
    at errnoException (dns.js:37:11)
    at Object.onanswer [as oncomplete] (dns.js:124:16)

пишет протокол (https, https,…) при установке host в собственность options

  // DON'T WRITE THE `http://`
  var options = { 
    host: 'http://yoururl.com',
    path: '/path/to/resource'
  }; 

в параметрах HTTP-запроса переключите его на

var options = { host: 'eternagame.wikia.com', 
                path: '/wiki/EteRNA_Dictionary' };

Я думаю, что это исправит вашу проблему.


  var http=require('http');
   http.get('http://eternagame.wikia.com/wiki/EteRNA_Dictionary', function(res){
        var str = '';
        console.log('Response is '+res.statusCode);

        res.on('data', function (chunk) {
               str += chunk;
         });

        res.on('end', function () {
             console.log(str);
        });

  });

Если вам нужно использовать https, используйте библиотеку https

https = require('https');

// options
var options = {
    host: 'eternagame.wikia.com',
    path: '/wiki/EteRNA_Dictionary'
}

// get
https.get(options, callback);

моя проблема заключалась в том, что моя служба DNS OS X (Mavericks) должна была быть перезагружается.


обратите внимание, что эта проблема также может возникнуть, если домен, на который вы ссылаетесь идет вниз (например. уже не существовать.)


Я думаю, что http делает запрос на порт 80, хотя я упомянул полный url-адрес хоста в объекте options. Когда я запускаю серверное приложение, которое имеет API, на порту 80, который я запускал ранее на порту 3000, он работал. Обратите внимание, что для запуска приложения на порт 80 вам потребуется root-привилегий.

Error with the request: getaddrinfo EAI_AGAIN localhost:3000:80

вот полный фрагмент кода

var http=require('http');

var options = {
  protocol:'http:',  
  host: 'localhost',
  port:3000,
  path: '/iso/country/Japan',
  method:'GET'
};

var callback = function(response) {
  var str = '';

  //another chunk of data has been recieved, so append it to `str`
  response.on('data', function (chunk) {
    str += chunk;
  });

  //the whole response has been recieved, so we just print it out here
  response.on('end', function () {
    console.log(str);
  });
}

var request=http.request(options, callback);

request.on('error', function(err) {
        // handle errors with the request itself
        console.error('Error with the request:', err.message);        
});

request.end();


я исправил эту ошибку с помощью этого

$ npm info express --verbose
# Error message: npm info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
$ nslookup registry.npmjs.org
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
registry.npmjs.org  canonical name = a.sni.fastly.net.
a.sni.fastly.net    canonical name = prod.a.sni.global.fastlylb.net.
Name:   prod.a.sni.global.fastlylb.net
Address: 151.101.32.162
$ sudo vim /etc/hosts 
# Add "151.101.32.162 registry.npmjs.org` to hosts file
$ npm info express --verbose
# Works now!

источник: https://github.com/npm/npm/issues/6686


Я попробовал использовать запрос модуль, и смог распечатать тело этой страницы довольно легко. К сожалению, с моими навыками, я ничем не могу помочь.


Я получил эту ошибку при переходе из среды разработки в рабочую среду. Я был одержим putting https:// по всем ссылкам. В этом нет необходимости, поэтому это может быть решением для некоторых.


Я избавился от http и дополнительной косой черты (/).
Я просто использовал это node-test.herokuapp.com и это сработало.


Если вы все еще сталкиваетесь с проверкой для настройки прокси, для меня это была настройка прокси, которая отсутствовала и не смогла сделать запрос, поскольку прямые http/https заблокированы. Поэтому я настроил прокси-сервер из своей организации, делая запрос.

npm install https-proxy-agent 
or 
npm install http-proxy-agent

const httpsProxyAgent = require('https-proxy-agent');
const agent = new httpsProxyAgent("http://yourorganzation.proxy.url:8080");
const options = {
  hostname: 'encrypted.google.com',
  port: 443,
  path: '/',
  method: 'GET',
  agent: agent
};

Я получил эту проблему решена путем удаления нежелательных символов из пароля для подключения. Например, у меня были следующие символы:


решение этой ошибки для меня было установить адресу http С менеджером пакетов узлов:

npm install http-server -g

Понравилась статья? Поделить с друзьями:
  • Error getaddrinfo enotfound postgres
  • Error getaddrinfo enotfound localhost
  • Error getaddrinfo enotfound api postman
  • Error get version перевод
  • Error get response code 500 try later