Hello everybody. I have the below error when I try to start node-red on Windows 10 even after uninstalling everything.
[error] Error: getaddrinfo ENOTFOUND ws://localhost:1880/ws/data
in GetAddrInfoReqWrap.onlookup [as full] (node:dns:71:26)
I saw some post that it is necessary to correct the address as shown below. But it wasn't necessary. Can anybody help me. Thank you very much.
This file was automatically generated by WSL. To stop the automatic generation of this file, add the following entry to /># [network]
#geraHosts = false
127.0.0.1 location
127.0.1.1 home.localdomain home
The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-all routers
More about the original textYou must provide the original text to see more information about the translation
Send feedback
side panels
In my experience of running Node-RED on a Windows PC and a second instance of Node-RED running in WSL on the same PC, I found using localhost or 127.0.0.1 can be problematic. Using the actual IP of the device (or WSL in this case) has less conflicts like this.
NOTE: I do use http://127.0.0.1:PORT only as the bookmark for my WSL instance, because the IP changes every time the PC is restarted. But this is only for the browser on that same PC (for obvious reasons).
I've been working on a multi-platform flow to create a context variable to resolve this problem with nodes that use an IP:PORT in one of their properties. You can read more about it here.
The problem is your Node-RED flow is trying to reach ws://localhost:1880/ws/data but it is unable to reach it, or it doesn't exist. However ws://ipaddress:1880/ws/data might work if you replace ipaddress with the correct one.
You must remember that WSL is a virtual environment inside Windows. Therefore it gets its own virtual network with a different IP address.
localhost and 127.0.01 is purely a LOCAL address. If you did a wget to the localhost address from the WSL command line against node-red running in the same WSL instance, it would work.
When WSL starts up, it should tell you what its "external" ip address is:
That is the address you must use from your Windows browser.
My friends solved the problem. When uninstalling nodejs and Node-Red I forgot to delete some files (.node and .node-red) from my user (older files) and when trying to re-install the new "NODE-RED" it searched for the oldest files ( to reference). After this action the red node is ok.