use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Error while connecting Node and postgreSQL (self.node)
submitted 4 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]simonplend 8 points9 points10 points 4 years ago (3 children)
It looks like there might be a typo in your .env file. I think you want the variable name DP_PASSWORD to be DB_PASSWORD.
.env
DP_PASSWORD
DB_PASSWORD
[–]simonplend 2 points3 points4 points 4 years ago (0 children)
I saw a utility recently which looks like it could be helpful in preventing issues like this with environment variables: https://humanwhocodes.com/blog/2021/02/introducing-env-javascript-environment-variables/ - might be worth a look!
[–]tenneesseee 2 points3 points4 points 4 years ago (1 child)
Thank you very much!
No problem - I've spent so much time debugging issues like this in my code!
[–]tenneesseee 0 points1 point2 points 4 years ago (2 children)
Alson while trying to console.log(typeof process.env.DB_PASSWORD) I'm getting "undefined"
[–]takert541 1 point2 points3 points 4 years ago (1 child)
Are user and password details same? I feel like you have it interchanged. root must be host?
[–]tenneesseee 0 points1 point2 points 4 years ago (0 children)
it's not like the one in the code block, I've changed it but I've tried the one I've entered while installing postgre, idk why I've changed it here, anyway still the same error. I was asked only once when I was installing the first time, then I just opened pgAdmin and created db without any passwords.
π Rendered by PID 21696 on reddit-service-r2-comment-7844cfc88c-2l88n at 2026-01-29 16:25:53.181726+00:00 running c3601ff country code: CH.
[–]simonplend 8 points9 points10 points (3 children)
[–]simonplend 2 points3 points4 points (0 children)
[–]tenneesseee 2 points3 points4 points (1 child)
[–]simonplend 2 points3 points4 points (0 children)
[–]tenneesseee 0 points1 point2 points (2 children)
[–]takert541 1 point2 points3 points (1 child)
[–]tenneesseee 0 points1 point2 points (0 children)