You could try out a few of the suggestions here: Cannot connect Node.js app to Postgres db - #15 by mhoggard