Skip to content
Home » Node/Postgresql Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)

Node/Postgresql Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)

To solve Node/Postgresql Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) follow any of the below methods.

Error log

Error: connect ECONNREFUSED 127.0.0.1:5432
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)

How to solve Node/Postgresql Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)

If you’re having problems with PostgreSQL on your Windows system, try restarting it with the following command:

pg_ctl -D "C:\Program Files\PostgreSQL\9.6\data" restart

If this does not solve your problem, try looking at the logs to see where the issue is.
The logs can be found in the directory percent PROGRAMFILES percent PostgreSQL9.3datapg log (adjusted for your PostgreSQL version and location if you did not use the defaults).

Also Read: Error: connect ECONNREFUSED 127.0.0.1:5432 when connecting with nodejs program