Before Node 17, dns.lookup reordered results to put IPv4 addresses first. Node 17.0.0 changed the default to verbatim: true, meaning the resolver returns addresses in the order the OS provides them. On a machine with an IPv6 loopback entry for localhost, that is usually ::1.
The visible symptom is a client getting ECONNREFUSED ::1:PORT while the server is running and reachable on 127.0.0.1:PORT. It happens because the server bound only to the IPv4 loopback, commonly by passing an explicit 127.0.0.1 host, while the client resolved localhost to the IPv6 address. Database drivers and local API clients in test suites hit this most often.
There are three fixes, in order of preference: bind the server to :: or omit the host so it listens on both stacks, connect to 127.0.0.1 explicitly instead of localhost, or force the old ordering with node --dns-result-order=ipv4first or dns.setDefaultResultOrder('ipv4first') at process start.