Search code examples
intellij-ideawebstormwindows-subsystem-for-linuxwsl-2sonarlint

SonarLint failed to analyze TypeScript code - WSL WebStorm IDE (Please configure the Node.js path in the SonarLint settings)


The problem

Hello everyone,

I'm working on an Angular project using the WebStorm IDE and Ubuntu 20.04 through WSL2.

I need to configure SonarLint for my project. However, it seems that it is not compatible with WSL right now. The problem is that it does not accept the Node.js path I've been providing:

enter image description here

\\wsl.localhost\Ubuntu-20.04\usr\bin\node

Then, when I try to execute a SonarLint analysis, it shows the following error notification:

enter image description here

SonarLint failed to analyze TypeScript code

SonarLint requires Node.js runtime version 16.0.0 or later to analyze TypeScript code.
Please configure the Node.js path in the SonarLint settings.

Everything is working except this extension and I can launch, test my project even if it is in WSL.

If anyone knows a workaround so that I could stay on WSL, I would be happy to try it! Thank you!

I've tried to...

  • use the path of both nodejs (/usr/bin/nodejs) and node (/usr/local/bin/node)
  • search for similar issues and I found this open issue that seems to be the same problem (https://sonarsource.atlassian.net/browse/SLI-711)
  • install NodeJS on Windows directly and tried with the path of the executable (C:\Program Files\nodejs\node.exe). It didn't work either.

Solution

  • Sadly, WSL remote paths are not supported by SonarLint yet.

    Issue & feature request to follow: