Skip to content

Instantly share code, notes, and snippets.

@tonysneed
Created October 23, 2016 07:09
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save tonysneed/bb6d442103a057578a9498f106e45ac5 to your computer and use it in GitHub Desktop.
Save tonysneed/bb6d442103a057578a9498f106e45ac5 to your computer and use it in GitHub Desktop.
Use Specific Version of TypeScript with VS Code

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/"
    }
@deepaktatineni
Copy link

run npm root -g to know the path for global typescript path

@Evavic44
Copy link

Evavic44 commented Jan 4, 2024

Relative import worked for me on windows:

"typescript.tsdk": "/usr/src/app/blog-app/node_modules/typescript/lib"

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