Error: Cannot find module 'typescript'


(Ryan K) #1

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
  • Community Edition Version 7.4 (build 18908)

I am using Team City as my CI.
SQ is being hosted in a Win Server 2012 R2. 12 gb of Ram. I have more than 50gig free.
When I have task manager RAM only 40% used

I have added several projects to SonarQube. Only a couple of project i encounter “Can not find typescript”
According to documentation I my version is higher than the min. requirements.

if you take a look at another issue I posted, it list all the plug-in installed and version. Out of memory: Java heap space

(Andrea Guarino) #2

Hi @RyanK,

SonarTS, i.e. our plugin used to analyze TypeScript files, needs to have “TypeScript” node module available either globally or locally on your project.

Given you already have node.js installed on your machine, you have two options:

  • (Recommended) Running npm install before starting an analysis on each of your TS project to make TypeScript module available.
  • Install TypeScript globally by running npm install -g typescript

Hope it clarifies.


(Ryan K) #3

Thanks @Andrea_Guarino

I tried installing it globally, but it did not work. I had to have the type script install on per build configuration. Good thing I am using templates.