It appears that launch.json does not pass on the PATH variable setting when testing the version of electron #865
Labels
bug
Issue identified by VS Code Team member as probable bug
*duplicate
Issue identified as a duplicate of another issue(s)
Describe the bug
I am unable to debug an electron application on macOS. Although Node.js is installed, the debug action fails immediately reporting:
Experimentation suggests that the problem is that although
launch.json
contains a setting for thePATH
environment variable, pointing to node's location, this setting is ignored when trying to determine the version of the electron application.To reproduce
It fails immediately, with above error (shown in a dropdown). No output is generated on the debug console.
Experimentation
I found that making any one of these changes by itself removed the issue:
debug.javascript.usePreview
to false, or"nodeVersionHint": 12
to the launch.json configuration, orPATH
environment variable set up to include/usr/local/bin
.I also found that if I added
"nodeVersionHint": 12
, but removed the assignment to thePATH
from the launch configuration then not surprisingly the debuggger is also unable to start with a similar error. This shows that the "env" setting is having an effect.Conclusion
I know that when VS Code is launched in the usual way, macOS does not pass it any
PATH
environment variable. But node is installed in/usr/local/bin
and electron is unable to start up without that folder being on thePATH
. I'd rather not startcode
from a terminal. So instead I'm telling VS Code to add the necessary path by usingWhen VS Code starts electron it is then able to find node. This worked with the old debugger. For the new debugger it still works, provided that I pass in a
nodeVersionHint
. I conclude that the environment setting is not being passed along when VS Code invokes electron to determine its version. When I pass in a hint, VS Code does not need to invoke electron to find the version, and it subsequently does set the path when it launches electron to start the debug session.I'm working round the problem (by including the node version hint) but I don't think I should have to do this.
Additional Information
The text was updated successfully, but these errors were encountered: