Skip to content

How can I update Visual Studio's version of TypeScript? #5995

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

Closed
johnfn opened this issue Dec 8, 2015 · 14 comments
Closed

How can I update Visual Studio's version of TypeScript? #5995

johnfn opened this issue Dec 8, 2015 · 14 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@johnfn
Copy link

johnfn commented Dec 8, 2015

I bothered @DanielRosenwasser with something similar on gitter yesterday, but I want to reduce the problem to something even easier.

I want to upgrade to the latest version of TypeScript - 1.7.3 - but I'm actually not sure how I can do that when using Visual Studio, which was installed with an older version. It seems like I must be somewhere around TypeScript 1.6, as both the exponentiation operator and this typing don't work.

What I've tried to do to upgrade my version:

It claims that TypeScript is already installed and there's nothing to do. Just for fun, I tried to remove it and reinstall it anyways. No luck.

  • npm install -g typescript

This had no effect, as far as I can tell.

  • npm install typescript

Also did nothing.

This stopped the red squiggles from appearing under my exponentiation operator and this type! Promising! However, when I try to compile, I get errors when I try to use features from 1.7 anyways. It's as if Visual Studio is using two separate compilers.

Thanks for your help.

@mhegazy
Copy link
Contributor

mhegazy commented Dec 8, 2015

TypeScript 1.7 is part of VS 2015 Update 1, please install VS 2015 Update 1.

If you enabled DevMode, it will always pick the files from this location, so if you are not doing active development on the TypeScript repo, i would disable it.

@mhegazy mhegazy added the Question An issue which isn't directly actionable in code label Dec 8, 2015
@johnfn
Copy link
Author

johnfn commented Dec 9, 2015

That is very helpful, thank you! Though I found it strange that I couldn't find a link to that anywhere on the TypeScript site.

Is there a way by which I can upgrade Visual Studio to the next version of TypeScript (that is, the latest off this repository)?

@mhegazy
Copy link
Contributor

mhegazy commented Dec 9, 2015

There are two pieces to the typescript plugin in VS; 1. The language service, this is your completion, colorization, signature help, etc.. You can update to the latest using the DevMode as you alluded to earlier. 2. The MSBuild integration pieces, this includes target file, tasks dll and the command line compiler executable (tsc.exe), you can update the manually, but there is nothing like the DevMode currently. We should have a nugget package available in the upcoming weeks, and that should making updating the MSBuild integration and command line compiler straight forward.

@mhegazy mhegazy closed this as completed Feb 20, 2016
@Methodician
Copy link

hey @mhegazy I seem to be stuck at TypeScript 1.8.34.0 (according to "About Microsoft Visual Studio") and I'm not sure how to update it using DevMode. I flollowed this and created the EnableDevMode key with a value of 1, but just don't see how that helps me get TypeScript to version 1.8.6. Maybe this thread is too old or maybe I just need directions?

@mhegazy
Copy link
Contributor

mhegazy commented Jul 11, 2016

this thread is probably not the same issue you are running into TS 1.8.34 is the latest TS 1.8.* release. it is the same compiler version as 1.8.10, but some updated VS plugin code, hence the higher version. so having TS 1.8.34 means you are all set with TS 1.8.

@Methodician
Copy link

Hmm... that throws me off because I've come across a number of forum posts saying that updating to 1.8.6 helped resolve the issue with compileOnSave not working. Plus, when I look here it says 1.8.6.0...

In any case, I've tried everything and can't get VS to compile my typescript unless I do a full rebuild after every change. I've scoured the forums and nothing has really helped. Oddly, it worked again for a little while after I switched to my new dev. machine but then stopped working again. I thought that was fixed? I have tsconfig compileOnSave set to true and have tried just about every other tweak or update I've found online. I can't believe it's still not working.

@mhegazy
Copy link
Contributor

mhegazy commented Jul 12, 2016

can you log a new issue, and give us some more information about what you are running into to help diagnose the problem?

@Methodician
Copy link

Yeah I'll do that if I should. I've hesitated to log an issue because lots of very closely related, though not identical, issues have been logged.

@PEsteves8
Copy link

I'm having the exact same issue. The tsconfig page indicates that compileOnSave is avaiable for typescrip TypeScript 1.8.4 and above, but my about page also indicates 1.8.35. Visual Studio doesn't compile the files unless I remove the tsconfig.json file. Seems to be the exact same thing as you, Methodician.

@Methodician
Copy link

Hey PEsteves8! I'm onto a new project now and it seems to be working
(though I'm working with .net 4.x rather than core ATM) but it was working
to start last time too, then stopped unexpectedly. I was wondering if you
could log an issue? @mohamed Hegazy suggested I do but I have never before
and not sure where to start and having trouble finding the time to research
the process...

Thanks!

On Fri, Jul 22, 2016 at 8:39 AM PEsteves8 [email protected] wrote:

I'm having the exact same issue. The tsconfig page indicates that
compileOnSave is avaiable for typescrip TypeScript 1.8.4 and above, but my
about page also indicates 1.8.35. Visual Studio doesn't compile the files
unless I remove the tsconfig.json file. Seems to be the exact same thing as
you, Methodician.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#5995 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEQPtqRpFRU8GNX-HqG14Wv-UZmqMttbks5qYOQfgaJpZM4GxOLc
.

@PEsteves8
Copy link

After multiple reinstalls/repairs, cache and temp folder deletions, things eventually started working, after I kind of installed Typescript 2.0 beta. I think. So problem solved.

@Methodician
Copy link

Mysterious bugs... A bit frustrating when noone can ever quite put their
finger on the root cause of a common problem but that's modern programming
for 'ya. Vast code bases with their own quirks.

On Wed, Jul 27, 2016 at 3:42 AM PEsteves8 [email protected] wrote:

After multiple reinstalls/repairs, cache and temp folder deletions, things
eventually started working, after I kind of installed Typescript 2.0 beta.
I think. So problem solved.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#5995 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEQPtqOdeckbvqcI5xpjCIs8M5UVyd3vks5qZzX_gaJpZM4GxOLc
.

@moozzyk
Copy link

moozzyk commented Oct 18, 2016

I guess the issue is that there are multiple tsc.exe on the path and the first one is the old one (in my case 1.0.3):

PS C:\Users\moozz_000> where.exe tsc
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.js
C:\Users\moozz_000\AppData\Roaming\npm\tsc
C:\Users\moozz_000\AppData\Roaming\npm\tsc.cmd

When you type just tsc the first is matched:

PS C:\Users\moozz_000> tsc --version
Version 1.0.3.0
PS C:\Users\moozz_000> tsc.cmd --version
Version 2.0.3

@jrasche
Copy link

jrasche commented Nov 3, 2016

I updated my VS C:\Program Files (x86)\Microsoft SDKs\TypeScript from 1.8 -> 2.0 via the Angular's VISUAL STUDIO 2015 QUICKSTART,

prereq #4 --> Download and install TypeScript 2.0 for Visual Studio 2015

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

6 participants