Whenever I press F5 or Ctrl+F5, vscode asks me to "select Environment". I have to choose Node.js every time. Somebody has given this solution: Run > Add Configuration > select Environment. It works for that particular folder. However, when I change folders the problem persists. How can I set up configurations globally? The worst part is that this problem started appearing since 4-5 weeks. Before that vscode was automatically debugging & running my files on node.js
The reason for not showing up the Extension Development Host window by pressing F5 in the first place is because my VS code workspace is not inside the project directory. The project directory contains the setup for launching the Extension Development Host window in launch.
F5 ⮕ Start/Continue This is the shortcut to initiate a debugging session or continue the session if paused.
F5 is used to start your project in debug mode and Ctrl-F5 is used to start your project without debug mode.
From within VS Code, you can create non-global environments, using virtual environments or Anaconda, by opening the Command Palette (Ctrl+Shift+P), start typing the Python: Create Environment command to search, and then select the command. The command presents a list of environment types: Venv or Conda.
I found a workaround. Installed this free extension code runner. https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner I had to set a custom shortcut key for enabling it to run since Ctrl+Alt+N didn't work for me.
The type
key is missing in /.vscode\launch.json (Access it from the top left gear icon or open it in vscode), please see @Andy's answer:
{
"version": "0.2.0",
"configurations": [
{
"type": "node", // to avoid the environment Select
"request": "launch",
"name": "Debug File",
"program": "${file}"
}
]
}
If the type
key is not there, Vscode asks you about the type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With