-
Notifications
You must be signed in to change notification settings - Fork 74
Description
For "Launch NPM" run configurations, any environment variables set in the "Environment" tab are not passed to the launched npm process or its children.
To reproduce, create a package.json with a script that prints its environment:
{
"scripts": {
"envtest": "node -e 'console.log(process.env)'"
}
}Then, create a "Launch NPM" configuration for this script, add some variables to the "Environment" tab, and run it. The resulting output won't show any of the variables you set. Meanwhile, running the same script from within a console will print any variables passed to it, like with VAR=VALUE npm run envtest or export VAR=VALUE; npm run envtest.
A workaround is to use an External Tool Configuration to handle launching NPM, which passes environment variables as expected. (It also offers a few other benefits, but that's a story for another issue 🙂 )