SonarLint in VS Code cannot analyze JavaScript or TypeScript files
sonarlint failed to analyze javascript codeShort answer
JavaScript and TypeScript analysis needs a supported Node.js: 22.12.0 or newer on the 22 line, or 24.0.0 or newer on the 24 line. Other majors such as 23 are not supported. Install a supported version and point the sonarlint.pathToNodeExecutable setting at that node binary.
Fix it fast
1Find out which cause you have
Find out which Node.js the shell and VS Code can see, and compare it with the supported ranges.
node -v which node2Match what you see, then jump to its fix
What does the error look like?
sonarlint failed to analyze javascript codeJS and TS files get no SonarLint findings, while other languages work
Cause 1 of 2
The Node.js on the PATH is not a supported version
1Check
The extension's requirements page names two supported lines for JS, TS and CSS analysis, and says other major versions are not supported.
node -v2Fix
Install a supported Node.js, for example with nvm, and use it as the default.
nvm install 24
nvm alias default 243Verify
Restart VS Code from a terminal where node -v prints the new version, then open a JS file.
node -v
code .Confirmed by docs.sonarsource.com
Cause 2 of 2
The extension found a different Node.js than the one you meant
1Check
The extension tries to locate Node.js on its own; you can set the location by hand.
echo $PATH && which -a node2Fix
Set the path explicitly in settings.json, to a supported node binary.
{
"sonarlint.pathToNodeExecutable": "/home/yourname/.nvm/versions/node/v24.0.0/bin/node"
}3Verify
Reload the VS Code window and open a JavaScript file; findings should appear.
# VS Code: Developer: Reload WindowConfirmed by docs.sonarsource.com
How do I stop it coming back?
- Keep to Node.js LTS lines when you pick a runtime. Node.js documents that odd-numbered releases such as 23 stop being supported after six months.
- Pin the node path in settings when you manage several versions with nvm.
- Recheck the requirements page after upgrading Node.js or the extension, since the supported ranges move.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- WorkforceA field app, an admin console and a self-hosted Node.js server for push and reconciliation.
Related fixes
Back end
Rollup stops with Unexpected token when it reaches a TypeScript file
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
Rollup parses plain JavaScript only.
3 causes, each with a fixBack end
TypeScript cannot find '@angular/platform-browser' in an Angular project
Cannot find module '@angular/platform-browser' or its corresponding type declarations.
TS2307 means TypeScript could not turn the import into a file.
3 causes, each with a fixBack end
Angular build fails with TS2707 or "has no exported member" after installing a library
Module '"@angular/core"' has no exported member
These errors mean a library was compiled by a newer Angular than your app uses.
3 causes, each with a fixBack end
cdk synth says --app is required
--app is required either in command-line, in cdk.json or in ~/.cdk.json
The CDK CLI needs a command that runs your app and finds it in three places: the --app option, cdk.json in the project folder, or cdk.json in your home folder.
3 causes, each with a fixBack end
The AWS SDK in Node.js cannot find any credentials
Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
The AWS SDK walks a fixed credential chain: code, environment variables, the shared files in ~/.aws, then role sources such as ECS or EC2.
3 causes, each with a fixBack end
AWS SDK for JavaScript v3 cannot find credentials, even for DynamoDB Local
A DynamoDB client pointed at http://localhost:8000 fails with the same message
The SDK walked its default credential provider chain and found nothing.
3 causes, each with a fix