-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding support for a custom node path
or setting version with NVM
#5456
Comments
@oriSomething can you please describe the use case? Doyou need this for debugging ? |
yes. |
@oriSomething you can set the "runtimeExecutable" of your launch config to the desired node.js version. |
I don't know if this is a question or feature request. To get the node version when we use nvm I use in the terminal:
The output I can paste in
So it picks up which version of node I'm using. But that doesn't work when trying to debug.
Can I make this work? Also, wouldn't that be a sane default? |
@jefffriesen variable substitution for ${...} in launch.json attributes does not use a shell. So the shell syntax But I do not see a reason why you want to use
In the September release you will be able to use |
@weinand I see what you're saying. When I first tried the debugger using nvm to set the node version, I got an error about node not being found (I didn't copy the error). I took what I got from So I don't know what happened and can't repeat it. Thanks. |
@jefffriesen in previous releases VS Code had a bug that would prevent the PATH environment variable from being correctly propagated to the place where we called "node". In this case node was not found and a workaround was to set |
Ok, good to know. I don't know why I got that error. It was the first time running the debugger. It's possible that I hadn't set nvm yet in the terminal, so no Node version was found. But that's usually the first thing I do when opening a terminal. Either way, I'm good. Thanks |
I used a workaround listed in #1895 to have VS Code use the NVM managed version of node in the |
@seanfisher I'll read about it. Thanks! |
borrowing @seanfisher's method, it's node.sh
.nvmrc
launch.json
this is enough (if NVM_DIR is exported, which it should be). make sure to specify legacy protocol for Node 4. |
adding support for a custom
node path
or setting version withNVM
. currently it only works with default alias ofNVM
. since the workspace i'm using it would be a hassle every time to change the default alias ofNVM
for every project.1.0.0
OS X 10.10.5
The text was updated successfully, but these errors were encountered: