npm doesn't update tsc version

It's likely that you have an old version of TypeScript installed for Visual Studio, and that the Visual Studio installation is shadowing the one installed through npm. You will probably need to change your PATH variable.

To check, open up a Command Prompt (CMD.exe) and type in

where tsc

If the first items are not associated with Node/npm, and are instead installed in something like C:\Program Files (x86)\Microsoft SDKs\TypeScript\..., then you'll need to configure your system environment variables.

  1. Open up your start menu.
  2. Search for system environment variables
  3. Open the item titled Edit the system environment variables
  4. Ensure that the PATH environment variable has the Node/npm location prioritized over the Visual Studio location.
    1. Also ensure that any newer Visual Studio installation locations are prioritized over older ones.

Also see this answer.


I believe you need to do

npm install -g typescript@latest

or

npm update -g typescript

As answered enter link description here


On windows, Open the command prompt and type: where tsc

This will give you a list of typescript versions your PATH and global settings are pointing to.

Go to the path: C:\xxxxx\Microsoft SDKs\TypeScript

Then delete the older version folder except latest one. Then check your current version again.

Have a good day!