ReplicaSetNoPrimary when attempting to connect from node

Another thread discusses same error

MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017

I think latest node.js does not support localhost
As per stackoverflow and other forums it may be due to IPV6 vs IPV4 address