microsoft / vscode-react-native

VSCode extension for React Native - supports debugging and editor integration
https://marketplace.visualstudio.com/items?itemName=vsmobile.vscode-react-native
Other
2.62k stars 262 forks source link

[Feature] Node.js binary path customization #2151

Open marlondecol opened 1 month ago

marlondecol commented 1 month ago

🚀 Feature request

It would be very helpful if we could set a custom node path for the packager to run.

What scenarios will this solve?

On systems implementing nvm, this configuration would provide a way to choose a Node.js version for the project without needing to set the default alias.


A question may arise: hasn't this already been implemented?

Well, I don't know, but I couldn't find a way to run the packager on another version of Node.js without explicitly running the nvm default alias command.

EzioLi01 commented 1 month ago

Hey @marlondecol , thanks for the suggestion. W'll look into this in the future. Also could please share some details for your scenario and the use case? Where or what command you need to customize node path?

EzioLi01 commented 1 month ago

Hey @marlondecol , do you have any update on this?

marlondecol commented 1 month ago

Hey @EzioLi01, thanks for keeping this open.

My system has two versions of Node.js installed and managed by nvm. The default is 20, which I use for almost all of my projects. One of them, however, needs it in 16, and so a .nvmrc file was created in the root of that project that tells the Z shell to switch to that version as soon as it is opened.

The Code can run all configured tasks that are based on Node.js in the appropriate version (the one set in .nvmrc), such as those that run on Yarn, for example, but this extension always runs the packager in the default version, regardless of the version required by .nvmrc.

The extension's command in question, which I believe is the responsible for running the packager, is this, but there may be others with the same problem.

EzioLi01 commented 1 month ago

Hey @EzioLi01, thanks for keeping this open.

My system has two versions of Node.js installed and managed by nvm. The default is 20, which I use for almost all of my projects. One of them, however, needs it in 16, and so a .nvmrc file was created in the root of that project that tells the Z shell to switch to that version as soon as it is opened.

The Code can run all configured tasks that are based on Node.js in the appropriate version (the one set in .nvmrc), such as those that run on Yarn, for example, but this extension always runs the packager in the default version, regardless of the version required by .nvmrc.

The extension's command in question, which I believe is the responsible for running the packager, is this, but there may be others with the same problem.

Hey @marlondecol , thanks for the details. We'll add this in our plan and look into this soon based on prioritization. Any update will comment here, if you have any thought or suggestion on this, please also let me know.

Thank you!