6

I have tried:

npm uninstall typescript -g

choco uninstall typescript

as well as looking in Programs for the visual studio uninstaller (which wasn't there), as mentioned here: uninstalling typescript without node

I still have 2 directories (1.0 and 1.1) under Microsoft SDKs and I don't see any sort of uninstaller in there.

I am wondering what is the cleanest way to remove all installations of TypeScript from my system?

Community
  • 1
  • 1
Mike Cheel
  • 12,626
  • 10
  • 72
  • 101
  • Which version[s] of Visual Studio (including Update versions) do you have installed? – Ryan Cavanaugh Oct 27 '14 at 20:16
  • I didn't install via VS extensions if that is what you are wondering BUT I am currently running VS 2010, VS 2013 and VS 14 CTP. Besides I want to start clean when I type tcs -v it shows the older version is being used. I could edit the environment variable but I prefer to work clean. – Mike Cheel Oct 27 '14 at 20:18
  • 2
    Version 1.0 is an integral part of VS2013, I doubt you'll want to uninstall the whole shebang. This is an XY question, nobody knows why you think you need to do this. – Hans Passant Oct 27 '14 at 20:19
  • Should I just rearrange the ENV variables to get 1.1 to get picked up? – Mike Cheel Oct 27 '14 at 20:20
  • 1
    Please describe your *actual* problem? Is it that `tsc` from the commandline is running a different version of TypeScript than you expect? – Ryan Cavanaugh Oct 27 '14 at 20:22
  • My original problem was that I wanted to uninstall typescript and start fresh but since it is apparently not uninstallable without removing visual studio my actual problem now is getting the 1.1 version to be used instead of the older one from the commandline. – Mike Cheel Oct 27 '14 at 20:25
  • @Hans fyi my main reason was because Chocolaty (i'm trying to use choocolaty more)wasn't picking it up when cup'd it and I also wanted to only have the latest version on my system. I also wanted to understand how it was installed on my system in the first place because I never specifically installed it. – Mike Cheel Oct 28 '14 at 16:13

4 Answers4

17

You can now uninstall "TypeScript Tools for Microsoft Visual Studio 2015" from the Control Panel in Programs and Features. It was automatically installed with Visual Studio 2015 in my case.

Dan Randolph
  • 741
  • 8
  • 14
3

TypeScript is built into both VS 2013 Update 2 the VS 14 CTP and cannot be separately uninstalled. You could uninstall both of those versions of Visual Studio if it is somehow critical to remove those folders.

Ryan Cavanaugh
  • 209,514
  • 56
  • 272
  • 235
1

You might have an old TypeScript installation on your computer because of a Microsoft SDK:

cmd>tsc --version
Version 1.0.3.0

If you check the PATH environment variable, you may find an entry like this:

C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\

In my case, the uninstallation of "TypeScript Tools for Microsoft Visual Studio 2015" did not remove tsc.exe etc. from this path, probably because it was installed as part of the Windows 10 SDK or something else.

You can remove the entry from the PATH environment variable or at least move it below the entry for Node.js (probably C:\Program Files\nodejs) or nvm (like C:\Users\<username>\AppData\Roaming\nvm) in case you use Node Version Manager. This will prevent that calls to tsc run the ancient TypeScript compiler:

cmd>tsc --version
Version 3.1.3

Don't forget to restart your command line after changes to environment variables for them to take effect!

If you are unsure what binary the tsc command will actually run then use the where command to find out:

cmd>where tsc
C:\Program Files\nodejs\tsc
C:\Program Files\nodejs\tsc.cmd
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.js

The priority is top to bottom. The first entry in my case is a (Linux) shell script and usually not executable on Windows. The second entry is a Windows Batch script and this is the one that will be executed. It basically invokes Node.js (simplified):

node.exe node_modules\typescript\bin\tsc
CodeManX
  • 11,159
  • 5
  • 49
  • 70
0

If you use nvm to manage multiple version node, try where tsc to find out the bin path. Maybe it is installed in another version node directory.

daskyrk
  • 132
  • 1
  • 10