The error message you are encountering is:
Error: listen EADDRNOTAVAIL: address not available 93.184.216.34:4443
at Server.setupListenHandle [as _listen2] (node:net:1795:21)
at listenInCluster (node:net:1860:12)
at GetAddrInfoReqWrap.doListen [as callback] (node:net:2009:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:8)
Emitted 'error' event on Server instance at:
at emitErrorNT (node:net:1839:8)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'EADDRNOTAVAIL',
errno: -49,
syscall: 'listen',
address: '93.184.216.34',
port: 4443
}
This error occurs when you are trying to listen on a specific IP address and port combination that is not available or cannot be reached. In some cases, modifying the hosts file on your system can help resolve this issue.
To solve the EADDRNOTAVAIL
error, you can follow these steps:
- Open the Hosts File: Locate and open the hosts file on your system. The hosts file is usually located at the following path:
- Windows:
C:\Windows\System32\drivers\etc\hosts
- Linux/Mac:
/etc/hosts
Note: Accessing the hosts file might require administrator/root privileges.
-
Add an Entry: Add the following entry at the end of the hosts file:
127.0.0.1 example.com
This entry maps the IP address
127.0.0.1
to the domain nameexample.com
. You can replaceexample.com
with the actual domain or hostname you are trying to use. -
Save the File: Save the changes to the hosts file.
-
Flush DNS Cache: To ensure that the changes take effect, flush your DNS cache. Open a command prompt/terminal and run the following command:
- Windows:
ipconfig /flushdns
- Linux:
sudo systemd-resolve --flush-caches
- Mac:
sudo killall -HUP mDNSResponder
- Retry the Application: Restart your application and see if the
EADDRNOTAVAIL
error is resolved. It should now be able to bind to the specified IP address and port combination.
By modifying the hosts file and adding an entry to map the desired IP address and hostname, you can resolve the EADDRNOTAVAIL
error. This solution can be particularly useful when the error is related to a specific IP address that is not directly reachable or available.
If the issue persists or if the error is not related to the hosts file, consider reviewing other potential causes such as network connectivity, firewall settings, or permission restrictions. Additionally, consult the documentation or support channels related to the specific application or framework you are working with for further assistance.