How to set environment variables when running node.js app in vs2019
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- node.js
- Domain
- tooling
Research direction
Start with the reported launch.vs.json configuration for the index.js app and compare it with the working VS Code launch.json setup. Reproduce the run in Visual Studio 2019, checking whether the environment value TEST_ENV and the two command-line arguments reach the app. Done means both environment variables and arguments are available when debugging.
Written by the indexing model from the issue text.
Description
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?
- Dominant language
- C#
- Stars
- 1.8k
- Forks
- 355
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/nodejstools
-
microsoft/nodejstools#2523 · 1 reaction · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/nodejstools#2519 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
microsoft/nodejstools#2517 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
microsoft/nodejstools#2514 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/nodejstools#2513 · 5 comments ·
All issues in microsoft/nodejstools
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·