Open 4javier opened 1 year ago
So I think what is happening here is the PATH
variable of VS code process doesn't have .nvm
in it when it is launched from the gnome dock.
The "run" buttons runs node
directly in the terminal, which resolves from the PATH
of the VS code terminal.
The "debug" button calls vscode.debug.startDebugging
, which uses the VS code API to resolve to an absolute path of the node
executable.
So "run" and "debug" use different PATH
variables here, notably "debug" does not use PATH
of the terminal it seems.
the user specific one pointing to current nvm symlink is listed before system one, so it should be picked by debugger.
I'm not sure if we want to do this, but if we did, vscode.debug.startDebugging
would need to be aware of the PATH
variable of the current active terminal I think? Or at least the way node
is resolved by the debugging would need to change, open to suggestions here
what is the status ?
For those who use .nvm. Try this - https://gist.github.com/Mupli/ac10cb67210ea932dfa7fbf9a1046cbf#file-nvmlink
When VSCode OSS gets launched from Gnome dock, executing a debugging session from the extension sets wrong
execPath
inVSCODE_INSPECTOR_OPTIONS
. In particular it misses the path set by NVM (Node Version Manager) and takes in account only system one/usr/bin/node
. At first I thought it was the dock not launching the IDE in a login shell, but the fact that the problem doesn't arise during normal test runnings but only during debugging, makes me wonder if the error resides somewhere else. I put a log statement inside my test to inspect ENV set during debugging, and they are the correct ones. In particular:As you can see, the user specific one pointing to current nvm symlink is listed before system one, so it should be picked by debugger. But in the same logging you can read:
If I launch VSCode from a terminal, execPath inside inspector options point to the correct user-wide Node path.