What's the cause of the error 'getaddrinfo EAI_AGAIN'?
EAI_AGAIN is a DNS lookup timed out error, means it is a network connectivity error or proxy related error.
My main question is what does dns.js do?
- The dns.js is there for node to get ip address of the domain(in brief).
Some more info:
http://www.codingdefined.com/2015/06/nodejs-error-errno-eaiagain.html
can't resolve getaddrinfo EAI_AGAIN error
For future readers, the problem is caused because the Binance's web socket server requires to respond to a ping frame within 10 minutes or the connection will be disconnected, so I get the 1006 error, I fixed this issue with a pong frame like this: ws.pong();
otherwise you will get a 1008 error code.
Example:
const ws = new WebSocket('wss://stream.binance.com:9443/ws/!bookTicker');
ws.onopen = function(message) {
console.log("Connected: ");
ws.pong();
}
ws.on("ping", function(message) {
ws.pong();
});
Error: getaddrinfo EAI_AGAIN database at GetAddrInfoReqWrap.onlookup [as oncomplete]
It looks like you have a service named database_ignite
in your docker-compose.yml
file. Docker by default creates a host using the name of your service. Try changing your host from database
inside your index.ts
file to database_ignite
:
import { Connection, createConnection, getConnectionOptions } from "typeorm";
export default async (host = "database_ignite"): Promise<Connection> => {
// Changed database to ^^ database_ignite ^^
const defaultOptions = await getConnectionOptions();
return createConnection(
Object.assign(defaultOptions, {
host,
})
);
};
npm ERR! code EAI_AGAIN error when trying to install express
I found the fix myself and what I basically did was use a different internet connection and I was able to install express! Hopefully someone else finds this useful!
Related Topics
How to Toggle an Element's Class in Pure JavaScript
How to Set Multiple CSS Styles in JavaScript
How to Expose Iframe's Dom Using Jquery
Ajax Mailchimp Signup Form Integration
How to Transpose a JavaScript Object into a Key/Value Array
How to Set Locale in Datepipe in Angular 2
Do You Ever Need to Specify 'Javascript:' in an Onclick
ASP.NET Postback with JavaScript
Manipulating Innerhtml Removes the Event Handler of a Child Element
Using _ (Underscore) Variable with Arrow Functions in Es6/Typescript
How Many Bytes in a JavaScript String
Get the Index of the Object Inside an Array, Matching a Condition
Are Braces Necessary in One-Line Statements in JavaScript
How to Create Separate Angularjs Controller Files
Check If All Values of Array Are Equal