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/" }
Thank you so so much!! ! VSCode's built in typescript was too old and not accurately providing intellisense, and the latest tTypeScript version made my language server crash. This saved me from having to use an older version!