zahedimahzad
zahedimahzad

Reputation: 153

sonarlint failed to analyze javascript code

sonarlint version: 6 , sonarqube version 9.2 , nodejs 16 and configuration : Node.js path is C:\programFile\nodejs but again plaese configure nodejs path in sonarlint setting.

Upvotes: 8

Views: 23527

Answers (3)

Peter Tarlos
Peter Tarlos

Reputation: 941

Either, configure the Sonar Plugin to use a newer Node install. (Ctrl+, sonarlint.pathToNodeExecutable)

Or, switch to an older version of the Sonar Plugin plugin that's compatible with your existing Node install.

  • On the VS Code Extension page, click the gear icon by the SonarLint extension, click Install Another Version, select an older version.
  • Disable auto update on the Extensions, so that you can stay on the older Plugin version. (Ctrl+, Extensions: Auto Update)

Upvotes: 1

ArlanG
ArlanG

Reputation: 1036

I had this issue on my VSCode SonarLint failed to analyze JSON code: Node.js runtime version 18.17.0 or later is required. Current version is 18.14.0. I updated the settings available on sonarlint.pathToNodeExecutable and added this path (Mac): /home/myname/.nvm/versions/node/v20.11.0/bin/node

Upvotes: 3

I solved it by setting the path to C:\Program Files\nodejs\node.exe on Sonar lint configuration.

Upvotes: 8

Related Questions