TypeScript - upgrade TypeScript compiler (tsc upgrade)

4 points
Created by:

In this short article we would like to show how to upgrade TypeScript compiler.

Quick solution:

npm -g upgrade typescript

or install newest version with:

npm -g install typescript

Note: install it will affect jumping to latest version.

Detailed description

Open terminal do following steps (in some cases as rootsuperuser or administrator):

  1. Check TypeScript version with command:
    tsc -v
  2. Run upgrade with command:
    npm -g upgrade typescript
    where: -g means global instalation mode
  3. Check TypeScript version again:
    tsc -v

Note: presented stemps work on different platforms (Windows, Linux, etc.).

Practical example:

$ tsc -v
Version 3.3.3333

$ npm -g upgrade typescript
C:\Users\john\AppData\Roaming\npm\tsc -> C:\Users\john\AppData\Roaming\npm\node_modules\typescript\bin\tsc
C:\Users\john\AppData\Roaming\npm\tsserver -> C:\Users\john\AppData\Roaming\npm\node_modules\typescript\bin\tsserver
+ typescript@3.9.6
updated 1 package in 13.424s

$ tsc -v
Version 3.9.6


Hey 👋
Would you like to know what we do?
  • Dirask is online IT community for professionals and hobbyist to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.