Skip to content

Instantly share code, notes, and snippets.

@wmaurer
Last active September 30, 2015 05:46
Show Gist options
  • Save wmaurer/261545665c00a481396b to your computer and use it in GitHub Desktop.
Save wmaurer/261545665c00a481396b to your computer and use it in GitHub Desktop.
Force Visual Studio Code to use a different (later) version of Typescript

Visual Studio Code and Typescript

Background: Visual Studio code releases are often slightly behind Typescript releases. For example, Typescript 1.6 (with JSX/TSX support) was released in 2015-09-11, but as of 2015-09-29, VSCode hadn't been updated to use Typescript 1.6.

You can, however, force VSCode to use the latest version of Typescript (tsc / tssserver). Let's assume you have Typescript installed globally via npm, i.e. you've run:

npm install -g typescript

Then it's mostly likely been installed in:

C:\Users\YOUR_USERNAME\AppData\Roaming\npm\node_modules\typescript

You can point VSCode to this particular version by customising your settings: File / Preferences / User Settings, and then adding the following key/value:

"typescript.tsdk": "C:\\Users\\YOUR_USERNAME\\AppData\\Roaming\\npm\\node_modules\\typescript\\lib"

You can also do this on a project by project basis: File / Preferences / Workspace Settings, and then adding the above key/value. In this case a .vscode\settings.json will be created in your project folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment