Own database PostgresSQL no longer functionall

To clarify:
I fixed it using that code on the bottom, yet I would like to still specify a pg version so I don’t have to go and change every single project I got any time a pg update comes on.

const { Client } = require("pg");
   const conString = new Client({
  connectionString: ''postgres://user:password@localhost/database''
});

  conString.connect((err, client) => {