Just thought id leave this here as i had some trouble with it:
If you are trying to use node-red-node-pi-gpiod and you are getting an error that the connection on localhost was refused although the daemon is running try changing
This is the way to loopback to localhost via ipv6 which when available is now being used by default by raspberry pi os if available. The daemon binds to this if started with the -l flag and up v6 is the Standard.
Maybe this saves somebody some googling.