i had the same problems hooking up to nodejs, pretty much. i didn’t realize postgresql was pre installed. i have only really used mlab or firebase in the past. anyways, this tutorial thing i’m doing is using this package
sequelize, and i figured why not try something new.
i finally figured out the port and created my database but i kept getting an error. long story short, the error was asking me to install an npm module called
pg. once i did that i was good to go. the
pg site mentions something about binaries or bindings or something? im not super familiar with all that but just running
npm i pg solved my problem. i even removed it and then reinstalled, sure enough the app would not connect once i uninstalled
also, probably good to explain that
\password <db_username> is how you get to password prompt. the tips above are changing the user/role
postgres password. idk but when i went in and made my first table it was under the user
ubuntu so i had to go in and change the password for that user to get things working.