sonarlint-visualstudio icon indicating copy to clipboard operation
sonarlint-visualstudio copied to clipboard

Node versions managed by NVM are not detected

Open rita-gorokhod opened this issue 2 years ago • 1 comments

Description

When locating a compatible node version for js/ts analysis, we search for node installations found in PATH. However, node installations managed by NVM would not be stored there, but rather under AppData\Roaming\nvm. This means that we cannot find versions other than the version set by nvm (via nvm use <version>).

Implications:

  • Our analysis might fail due to no compatible node version being found under PATH --> this is fixable by the user by running nvm use or manually adding the specific node version to PATH.
  • The telemetry field MaxNodeJsVersion is not calculated correctly. See also #2997.

TODO:

  • [ ] Implement a new INodeLocationsProvider that searches for NVM-managed installations.

rita-gorokhod avatar Apr 27 '22 09:04 rita-gorokhod

Is there any update for this?

JinPengGeng avatar Sep 06 '22 15:09 JinPengGeng

Even adding nvm path in settings doesn't get recognized. "sonarlint.pathToNodeExecutable": "~/.nvm/versions/node/v16.17.1/bin/node",

Would appreciate some help, please.

ARehmanMahi avatar Sep 26 '22 16:09 ARehmanMahi

Even adding nvm path in settings doesn't get recognized. "sonarlint.pathToNodeExecutable": "~/.nvm/versions/node/v16.17.1/bin/node",

@ARehmanMahi this is the SonarLint for Visual Studio repo, not VSCode. Feel free to open issues in our community forum for the appropriate IDE: https://community.sonarsource.com/c/sl/11

rita-gorokhod avatar Sep 26 '22 17:09 rita-gorokhod

Sorry, my bad,

By the way, I had to use the absolute path instead of the Tilda and it worked. "sonarlint.pathToNodeExecutable": "/home/abdul/.nvm/versions/node/v16.17.1/bin/node",

ARehmanMahi avatar Sep 26 '22 17:09 ARehmanMahi