[error] Error: getaddrinfo ENOTFOUND ws://localhost:1880/ws/data at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)

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.