Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsc.exe should point to latest tsc after installing out of band installers #2068

Closed
danquirk opened this issue Feb 18, 2015 · 16 comments

Comments

@danquirk
Copy link
Member

commented Feb 18, 2015

Can we fix this or is cmd too limited? After installing 1.4 out of band (https://visualstudiogallery.msdn.microsoft.com/2d42d8dc-e085-45eb-a30b-3f7d50d55304) on top of VS2013 my command prompt experience is still stuck at 1.0:

C:\>tsc -v
Version 1.0.0.0

C:\>where tsc
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.js
C:\Program Files (x86)\Microsoft SDKs\TypeScript\0.9\tsc.exe
C:\Program Files (x86)\Microsoft SDKs\TypeScript\0.9\tsc.js
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1\tsc.exe
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1\tsc.js
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\tsc.exe
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\tsc.js

@danquirk danquirk added the Bug label Feb 18, 2015

@DanielRosenwasser

This comment has been minimized.

Copy link
Member

commented Feb 19, 2015

We should just be looking for an existing install, and put the newer one earlier in the PATH. To me this is an installer issue more than a tsc.exe issue.

Unless you also want it to use the latest npm-installed tsc.js. Which is probably harder.

@basarat

This comment has been minimized.

Copy link
Contributor

commented Feb 19, 2015

What's more the older versions couldn't be uninstalled. 1.1 sticks around so I just deleted it with malice.

@danquirk

This comment has been minimized.

Copy link
Member Author

commented Feb 19, 2015

Yes, I meant our installer should fix this and add the latest ones to the PATH in the right order. The older versions should be uninstallable through ARP.

@mhegazy

This comment has been minimized.

Copy link

commented Mar 11, 2015

@paulvanbrenk can you take a look.

@mhegazy mhegazy added this to the TypeScript 1.6 milestone Mar 26, 2015

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented Mar 26, 2015

There is no good way to remove entries from the path environment variable using the installer. So we decided to no longer add the path to tsc.exe to the Path environment variable.

@danquirk

This comment has been minimized.

Copy link
Member Author

commented Mar 26, 2015

Ok, let's consider an alternative where we create a %TSC% environment variable and put that variable on %PATH%. It's not perfect since tsc would then be bound to the last installed version (rather than the actual latest version) but it probably does the right thing for most people most of the time.

@danquirk danquirk reopened this Mar 26, 2015

@danquirk danquirk added Suggestion and removed Bug Won't Fix labels Mar 26, 2015

@basarat

This comment has been minimized.

Copy link
Contributor

commented Mar 26, 2015

Ok, let's consider an alternative where we create a %TSC% environment variable and put that variable on %PATH%

👍 People will need to manually remove the old paths for now.

@mhegazy mhegazy modified the milestone: TypeScript 1.6 Jul 1, 2015

@nenadvicentic

This comment has been minimized.

Copy link

commented Jul 5, 2015

This might be good approach to solve the problem. Oracle's registration of Java path:
Path: C:\ProgramData\Oracle\Java\javapath
Folder content:

<SYMLINK>  java.exe [C:\Program Files\Java\jre1.8.0_45\bin\java.exe]
<SYMLINK>  javaw.exe [C:\Program Files\Java\jre1.8.0_45\bin\javaw.exe]
<SYMLINK>  javaws.exe [C:\Program Files\Java\jre1.8.0_45\bin\javaws.exe]
@rkavalap

This comment has been minimized.

Copy link

commented Oct 29, 2015

Note: Adding it to the %PATH% environment variable is not sufficient. Since C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat will override this when using the developer command prompt compared to regular cmd prompt. Manually Editing the file is essentially breaking support for patches when installing a patch. (If i am not mistaken, the file should will not be overwritten, unless there is a custom action within the installer which overrides the modified time stamp of the file).
The change also needs to be present within visual studio installer as well.

I like @nenadvicentic suggestion as well.

@mhegazy

This comment has been minimized.

Copy link

commented Dec 9, 2015

The installer is not touching the %PATH% any longer. this issue persists from older releases. I do not think there is a good solution here.

@hiredgunhouse

This comment has been minimized.

Copy link

commented Jun 24, 2016

You say "I don't think there is a good solution here" but what is your workaround? Manually deleting the old tsc.exe or updating the PATH? Cause apparently I cannot uninstall my 1.0 TypeScript which is causing me problems.
Could you at least suggest what a good workaround is cause you'll have people coming here looking for solutions rather than finding out that you decided to close the issue with no fix, which is disappointing.

@paulvanbrenk

This comment has been minimized.

Copy link
Contributor

commented Jun 24, 2016

@hiredgunhouse Remove the existing tsc.exe entries from the PATH environment variable and manually add the location you do want referenced.

@zspitz

This comment has been minimized.

Copy link
Contributor

commented Aug 18, 2016

I had the following entries which I had to remove:

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

Visual Studio Code was still trying to use the one in the PATH, and kept trying to compile with 1.0.3.

@ztamizzen

This comment has been minimized.

Copy link

commented Jan 20, 2017

Running tsc.cmd helps though.
And I'd say the issue is not resolved, I had the same problem TODAY. 1.0 is still in the path and I installed 2.1.

@xhallix

This comment has been minimized.

Copy link

commented Feb 23, 2017

I have the case that I added tsc from npm path to my PATH -env, but it still uses the sdk version, even though this is not set on the path.
Is there a way to fix this?

@mhegazy sorry that was not my best moment ;)

@mhegazy

This comment has been minimized.

Copy link

commented Feb 23, 2017

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
You can’t perform that action at this time.