I have so far been unable to get windows to accept environment variables. I have tried from inside the IDE, outside in terminal, and via powershell terminal, but no luck so far.
I am moving to using the dotenv library as a fix, but would love to know if this is an outdated problem (as Mosh Node course seems a bit dated) or if it’s just a problem with my machine or setting variables in windows.
It kinda works, the strange part is if I run execute the log script directly from the IDE (jetbrains webstorm) I get ‘undefined’, but if I execute the script using node scriptFile.js in the terminal (also inside the IDE) I get the correct output.
So it turns out there is a config area hidden away in Webstorm to define env variables for development, I will have to see how it plays out for production/deployment.