Sonar scanner with typescript (node)

I am currently performing a code analysis with sonar scanner to a project developed in typescript but I am presented with the following error:
SonarQube version 7.9 LTS
The sonarscanner version 3.2.0.1227
The node version 14.17.0

INFO: Scanner configuration file: NONE
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 3.2.0.1227
INFO: Java 1.8.0_291 Oracle Corporation (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\jlino.sonar\cache
INFO: SonarQube server 7.9.1
INFO: Default locale: “es_EC”, source code encoding: “windows-1252” (analysis is platform dependent)
WARN: SonarScanner will require Java 11+ to run starting in SonarQube 8.x
INFO: Load global settings
INFO: Load global settings (done) | time=824ms
INFO: Server id: D76A0480-AWzZcFNXWeYh70JMYLbb
INFO: User cache: C:\Users\jlino.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=653ms
INFO: Load/download plugins (done) | time=813ms
INFO: Loaded core extensions: developer-scanner
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=6ms
INFO: Project key: APL_BizbankEmpresarial_TS
INFO: Base dir: D:\SQ_CodigoPrueba\TypeScript**
INFO: Working dir: D:\SQ_CodigoPrueba\TypeScript**.scannerwork
INFO: Load project settings for component key: ‘APL_BizbankEmpresarial_TS’
INFO: Load project settings for component key: ‘APL_BizbankEmpresarial_TS’ (done) | time=689ms
INFO: Load project branches
INFO: Load project branches (done) | time=670ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=563ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=2ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=883ms
INFO: Load active rules
INFO: Load active rules (done) | time=20715ms
INFO: Branch name: branch-jlino, type: long living
INFO: Indexing files…
INFO: Project configuration:
INFO: Excluded sources: Presentacion//Scripts/umd/, Presentacion//Scripts/JQuery/, Presentacion//Scripts/Bootstrap/
INFO: Excluded sources for duplication: Aplicacion//Entidades/DTO/, PCK_*
INFO: Load project repositories
INFO: Load project repositories (done) | time=648ms
INFO: 408 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: Quality profile for css: Sonar way
INFO: Quality profile for ts: Sonar way
INFO: Quality profile for web: Sonar way
INFO: ------------- Run sensors on module APL_BizbankEmpresarial_TS
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=686ms
INFO: Sensor SonarCSS Metrics [cssfamily]
INFO: Sensor SonarCSS Metrics [cssfamily] (done) | time=3154ms
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=99023ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=5ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=6327ms
INFO: Sensor SonarTS [typescript]
INFO: Analyzing 242 typescript file(s) with the following configuration file D:\SQ_CodigoPrueba\TypeScript**\tsconfig.json
ERROR: internal/modules/cjs/loader.js:888
ERROR: throw err;
ERROR: ^
ERROR:
ERROR: Error: Cannot find module ‘typescript’
ERROR: Require stack:
ERROR: - D:\SQ_CodigoPrueba\TypeScript**.scannerwork\sonarts-bundle\node_modules\tslint\lib\language\walker\blockScopeAwareRuleWalker.js
ERROR: - D:\SQ_CodigoPrueba\TypeScript**.scannerwork\sonarts-bundle\node_modules\tslint\lib\language\walker\index.js
ERROR: - D:\SQ_CodigoPrueba\TypeScript**.scannerwork\sonarts-bundle\node_modules\tslint\lib\language\rule\abstractRule.js
ERROR: - D:\SQ_CodigoPrueba\TypeScript**.scannerwork\sonarts-bundle\node_modules\tslint\lib\rules.js
ERROR: - D:\SQ_CodigoPrueba\TypeScript**.scannerwork\sonarts-bundle\node_modules\tslint\lib\index.js
ERROR: - D:\SQ_CodigoPrueba\TypeScript**.scannerwork\sonarts-bundle\node_modules\tslint-sonarts\lib\runner\rules.js
ERROR: - D:\SQ_CodigoPrueba\TypeScript**.scannerwork\sonarts-bundle\node_modules\tslint-sonarts\lib\runner\processRequest.js
ERROR: - D:\SQ_CodigoPrueba\TypeScript**.scannerwork\sonarts-bundle\node_modules\tslint-sonarts\lib\runner\tsrunner.js
ERROR: - D:\SQ_CodigoPrueba\TypeScript**.scannerwork\sonarts-bundle\node_modules\tslint-sonarts\bin\tsrunner
ERROR: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
ERROR: at Function.Module._load (internal/modules/cjs/loader.js:730:27)
ERROR: at Module.require (internal/modules/cjs/loader.js:957:19)
ERROR: at require (internal/modules/cjs/helpers.js:88:18)
ERROR: at Object. (D:\SQ_CodigoPrueba\TypeScript**.scannerwork\sonarts-bundle\node_modules\tslint\lib\language\walker\blockScopeAwareRuleWalker.js:20:10)
ERROR: at Module._compile (internal/modules/cjs/loader.js:1068:30)
ERROR: at Object.Module._extensions…js (internal/modules/cjs/loader.js:1097:10)
ERROR: at Module.load (internal/modules/cjs/loader.js:933:32)
ERROR: at Function.Module._load (internal/modules/cjs/loader.js:774:14)
ERROR: at Module.require (internal/modules/cjs/loader.js:957:19) {
ERROR: code: ‘MODULE_NOT_FOUND’,
ERROR: requireStack: [
ERROR: ‘D:\SQ_CodigoPrueba\TypeScript\\\.scannerwork\sonarts-bundle\node_modules\tslint\lib\language\walker\blockScopeAwareRuleWalker.js’,
ERROR: ‘D:\SQ_CodigoPrueba\TypeScript\\\.scannerwork\sonarts-bundle\node_modules\tslint\lib\language\walker\index.js’,
ERROR: ‘D:\SQ_CodigoPrueba\TypeScript\\\.scannerwork\sonarts-bundle\node_modules\tslint\lib\language\rule\abstractRule.js’,
ERROR: ‘D:\SQ_CodigoPrueba\TypeScript\\\.scannerwork\sonarts-bundle\node_modules\tslint\lib\rules.js’,
ERROR: ‘D:\SQ_CodigoPrueba\TypeScript\\\.scannerwork\sonarts-bundle\node_modules\tslint\lib\index.js’,
ERROR: ‘D:\SQ_CodigoPrueba\TypeScript\\\.scannerwork\sonarts-bundle\node_modules\tslint-sonarts\lib\runner\rules.js’,
ERROR: ‘D:\SQ_CodigoPrueba\TypeScript\\\.scannerwork\sonarts-bundle\node_modules\tslint-sonarts\lib\runner\processRequest.js’,
ERROR: ‘D:\SQ_CodigoPrueba\TypeScript\\\.scannerwork\sonarts-bundle\node_modules\tslint-sonarts\lib\runner\tsrunner.js’,
ERROR: ‘D:\SQ_CodigoPrueba\TypeScript\\\.scannerwork\sonarts-bundle\node_modules\tslint-sonarts\bin\tsrunner’
ERROR: ]
ERROR: }
ERROR: Failed to find ‘typescript’ module. Please check, NODE_PATH contains location of global ‘typescript’ or install locally in your project
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 2:47.185s
INFO: Final Memory: 40M/629M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Failed to run external process node --max-old-space-size=2048 D:\SQ_CodigoPrueba\TypeScript\****\****\.scannerwork\sonarts-bundle\node_modules\tslint-sonarts\bin\tsrunner. Run with -X for more information
ERROR: Caused by: Ha terminado la canalización
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

Your help please

Hi Jorge,

SonarQube 7.9 LTS is not supported anymore, since SonarQube 8.9 LTS was released in May this year. Could you please upgrade and try running the analysis again?

Happy to help with the upgrade if you have any questions.

Cheers,
Daniel

Thank you :smiley:

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