I have set the environment variable for windows as follows:
setx port 8080 /M
#prints out the expected output
echo %port%
And have following code in my file.js
const port = process.env.PORT;
console.log(port);
But it always prints out the value as undefined and my application does not start, despite the fact that this environment variable exists in my system. Thank you for your help.