How do I solve a var.map is not a function TypeError?

Perhaps this can be useful information :

When I run “yarn develop” or “npm start” on the API project, I get an error :

debug ⛔️ Server wasn't able to start properly.
error Error: connect ECONNREFUSED 127.0.0.1:5432
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)