Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set environment variables when running node.js app in vs2019 #2331

Open
sabrogden opened this issue May 14, 2021 · 0 comments
Open

How to set environment variables when running node.js app in vs2019 #2331

sabrogden opened this issue May 14, 2021 · 0 comments

Comments

@sabrogden
Copy link

I have a very simple node.js console app that most of the time and others on our team run in vsCode. This is just a folder with an index.js and package.json.

I would like to run this in visual studio. The problem I'm having is how to configure the environment variables and command line options. In vsCode we have a configuration in launch.json that defines things, this works good in vsCode.

But in visual studio I'm not sure how to set these. I have tried to set values in launch.vs.json but I'm not seeing the environment variables loading.

{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "nodeDbg",
"name": "Test.1",
"project": "index.js",
"projectTarget": "index.js",
"environment": {
"TEST_ENV": "test"
},
"args": [ "--JobKey=x", "--OverrideOrganizationId=y" ]
}
]
}

I'm not seeing the environment variables or args populating. Is this the correct way to set these? Different tags?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant