coreybutler / nvm-windows

A node.js version management utility for Windows. Ironically written in Go.
MIT License
36.01k stars 3.24k forks source link

[Feature]: Manually specifying a custom location of Node.js installation - Visual Studio 2022 #1151

Closed afonsoft closed 2 weeks ago

afonsoft commented 3 weeks ago

Description of the new feature / enhancement

[Feature]: Manually specifying a custom location of Node.js installation - Visual Studio 2022

image

You can also set the environment variable SONAR_NODEJS_PATH to specify a custom location. The value should be the full file path to the node executable e.g. c:\custom\node.exe. The environment variable takes precedence over the automatic detection. You will need to restart Visual Studio after setting or changing the environment variable.

I Need do set a variable SONAR_NODEJS_PATH on change a node version.

Scenario when this would be used?

Error on Visual Studio 2022 for SonarLint becouse not found a node version in variable.

Supporting information

No response

coreybutler commented 3 weeks ago

It seems like you just need to set SONAR_NODEJS_PATH to the value of NVM_SYMLINK. I don't see how this is an NVM4W feature.

afonsoft commented 3 weeks ago

True, but is there no way to make this setting automatic? Have you already put this option in the system variables?

SET SONAR_NODEJS_PATH=%NVM_SYMLINK% or something like that.

image

coreybutler commented 2 weeks ago

What you have in your screenshot should work, because NVM_SYMLINK is registered when NVM4W is installed. Setting SONAR_NODEJS_PATH is the responsibility of Visual Studio or the user.