Complaint that Node.js runtime >= v8.0.0 is Required (But is Installed)

In Visual Studio Code, getting the notification that “SonarLint failed to analyze JavaScript code: Node.js runtime version 8.0.0 or later is required.”

This is appearing on a React-based project (wherein which Node.js is absolutely a requirement and is installed). From the docs, I understand that SonarLint will automagically determine the location of the installed JRE. Is this not true for Node.js? Further, is there even a config to clue-in SonarLint as to the location of Node.js (as there is for the JRE)? I’d prefer NOT to take this route as this would necessitate me making sure every one of our Developers installs Node in the same location on their drive. That is not ideal.

Any help is appreciated.

Visual Studio Code v1.51.1
SonarLint v1.18.0

> node --version; npm --version
v12.18.2
6.14.5

Hello, welcome to the community! And thank your for your question.

SonarLint for VSCode will try to find a node executable in the $PATH and detect its version. If it cannot (and this is for instance true if the Node install is managed with nvm), then the actual path can be set using the sonarlint.pathToNodeExecutable property.

Since this property has the machine scope, it can be set by each developer in their “User Settings” according to the path where they install Node.

1 Like

Excellent! Will give it a go…

Thank you, Jean-Baptiste…

@JBL_SonarSource

Seems to be working. No idea why the Node instance could not be found. I do not use any Node versioning and node.exe sits in a fairly-common installation folder stucture: (C:\Program Files (x86)\nodejs).

Just glad to have Node.js being recognized by SonarLint now.

Again, thank you!

R. J.

1 Like

You’re most welcome :slight_smile:

Community members previously reported that in some cases, another tool’s node.exe is on the %PATH% and takes precedence over the one from Node.js - and it such case it would be pretty hard for SonarLint to detect that it’s not the real thing :sweat_smile:

Anyway, glad you got it to work!

:+1: Good to know!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.