Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update Typescript IntelliJ

Is it possible to update the typescript compiler that IntelliJ uses? The bundled version is currently displayed as 2.0.8, but I have the latest 2.1 installed (from npm). How do I get IntelliJ to use this updated version of typescript?

like image 385
Andi Gu Avatar asked Dec 06 '22 15:12

Andi Gu


2 Answers

Go to settings(alt+ctrl+s) -> Languages & Frameworks -> Typescript

Click on Edit.. button next to Typescript Version:

Select custom directory and browse the path to your latest typescript location.

location of your latest npm installation of typescript can be found using (if installed globally):

npm list -g 
like image 154
Kay Avatar answered Dec 09 '22 14:12

Kay


The latest versions of Webstorm (and hence IDEA) will automatically detect the version of typescript if you install it as part of your node modules.

Thus, in package JSON, making it a dev dependency

"devDependencies": {
  "typescript": "2.1.4"
}

then running npm install will have your IDE automatically detect it. (this behaviour can be overridden in the typescript settings)

Although this will multiply typescript installs on your machine:

  • typescript is still a reasonably sized package
  • you can have projects using different versions of typescript
  • upgrading the globally installed typescript, if you need any, will not break your existing code
like image 36
Bruno Grieder Avatar answered Dec 09 '22 15:12

Bruno Grieder