Terminal Environment variables not being respected Follow
I've got 3 environment variables that I set in Settings->Terminal.
HTTPS=true;SSL_CRT_FILE="D:\dev\localhost.crt";SSL_KEY_FILE="D:\dev\localhost.key"
However, when I run "npm start", my variables are ignored. I have to pass them into the command line to make them work:
HTTPS=true SSL_CRT_FILE="D:\dev\localhost.crt" SSL_KEY_FILE="D:\dev\localhost.key" npm start
This started with WebStorm 2021.2.1. I'm on Windows 10. My default terminal is Git Bash.
Please sign in to leave a comment.
Can't reproduce
What is a result of running
echo $SSL_KEY_FILE
in the build-in terminal? Please share a screnshot of the File | Settings | Tools | Terminal page
The result of the echo is: D:\dev\localhost.key.
Again though, when I run just "npm start", I get errors that my page isn't secure. But when I run the whole line:
My page loads as expected.
Screenshot:

>The result of the echo is: D:\dev\localhost.key
so the variable is resolved, isn't it?
I see where you're going and sure, the echo worked. But then why when I run "npm start", it doesn't pull from the environment variables? Why would I have to pass them in on the command line?
No idea... I've just checked that if I create a code like
add npm script that runs this code, set FOO in terminal preferences and then run this script in terminal, it works as expected:
I did the same thing. I added:
And all I got was an "undefined".
Just to add, this is inside of a React project.
What does `printenv SSL_CRT_FILE` say in the built-in terminal? What's your Git Bash version?
Thanks for the information. So, `SSL_CRT_FILE` environment variable is passed to `printenv` process, but is not passed to `npm start`. What's the output if you run `node KevisTest.js` directly in the built-in terminal?