NOTE: These steps are only required if you want to use a version of TypeScript that is not the same as the version that is bundled with Visual Studio Code.
-
Install the latest version of TypeScript
npm install -g typescript@version
-
Configure VS Code to use installed version of TypeScript by opening Preferences, User Settings.
- Settings on Mac:
{ "typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib/" }
- Settings on Windows - substitute {User Name}:
{ "typescript.tsdk": "c:\\Users\\{User Name}\\AppData\\Roaming\\npm\\node_modules\\typescript\\lib" }
- Settings on Linux:
{ "typescript.tsdk": "/usr/lib/node_modules/typescript/lib/" }
Might I suggest using a local install of TypeScript, rather than a global one? That way, if you're working on multiple projects, you can update the TypeScript versions independently: