question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OS level NODE_OPTIONS env variable is not respected

See original GitHub issue

Describe the bug When defining NODE_OPTIONS env variable at OS level it is being overriden when starting debug session.

To Reproduce Steps to reproduce the behavior:

  1. Clone this repo
  2. Add to Extension launch config:
"env": {
    "NODE_OPTIONS": "--use-openssl-ca"
}
  1. Run extension launch config
  2. In the extension development host create index.js file that contains console.log(process.env.NODE_OPTIONS)
  3. Create the following launch config:
 {
       "name": "Launch Program",
       "program": "${workspaceFolder}/index.js",
       "request": "launch",
       "skipFiles": [
          "<node_internals>/**"
       ],
       "type": "node"
 }
  1. Run it with Debug › JavaScript: Use Preview enabled - --require "c:/Users/i318734/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js" is displayed.
  2. Run it with Debug › JavaScript: Use Preview disabled - --use-openssl-ca is displayed.

I would expect that NODE_OPTIONS OS value will be concatenated to the new value instead of being replaced. My use case is to load certificates from the OS certificate store by default for any node process instead of using the bundled NodeJS certificate store.

Log File

VS Code Version: 1.47.3

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
connor4312commented, Oct 13, 2020

Early next month

0reactions
shahar-hcommented, Oct 13, 2020

Thanks, do you know when v1.51.0 will be released?

Read more comments on GitHub >

github_iconTop Results From Across the Web

'NODE_OPTIONS' is not recognized as an internal or external ...
On my terminal node is recognized just fine, for example I get the version when I run node --version . But running the...
Read more >
Environment variable set but not respected
You've set it, but not exported it. Change the line to this: export EDITOR=vim.
Read more >
Command-line API | Node.js v19.3.0 Documentation
Options from the command line take precedence over options passed through the NODE_OPTIONS environment variable. - #. Added in: v8.0.0. Alias for stdin....
Read more >
config | npm Docs
Options to pass through to Node.js via the NODE_OPTIONS environment variable. This does not impact how npm itself is executed but it does...
Read more >
Working with Environment Variables in Node.js - Twilio
If you don't see the installed Node.js version, you may need to relaunch your terminal. To ensure the installation is correct and running...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found