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

Simple way to install typescript #7998

Closed
werddomain opened this issue Apr 10, 2016 · 4 comments

Comments

@werddomain
Copy link

commented Apr 10, 2016

TypeScript Version:

1.8.5

Problem
i have installed vs 2013 ultimate update 5 then try to compile my code.
Error was throw about syntax so im thinking i dont have an updated version, so i installed 1.8.5 by:
https://www.microsoft.com/en-us/download/details.aspx?id=48739

now vs2013 generate js file when i save but give compilation error on build.

It's hard to know what to do ...
i have posted a question on stackoverflow:
http://stackoverflow.com/questions/36534217/compile-error-but-js-get-generated

alsow i dont know what information/log to provide ...

@RyanCavanaugh

This comment has been minimized.

Copy link
Member

commented Apr 11, 2016

@paulvanbrenk can you help out?

@mhegazy

This comment has been minimized.

Copy link

commented Apr 11, 2016

In your project file, do you have a <TypeScriptToolsVersion></TypeScriptToolsVersion> property? I am guessing you do, and it is set to 1.4 possibly; remove it and save the project, that should do the trick.

@werddomain

This comment has been minimized.

Copy link
Author

commented Apr 11, 2016

It was set to 1.7 and i have try it to 1.8.
What's strange is one project build but not the other.
i have call "tsc -v" and it say 1.0, when i have made "where tsc" it show only the 1.0 folder and romanin or something like that. I have copied 1.8 to 1.0 and now all build ... but i dont like the way it feel like a hack...

If i remove the project ts version, it will not be confusing on wish this project is based on?
i mean if someone else setup this project with the wrong ts version, no warning will be displayed to the user ...

My problem is "patched" but i steel dont like the way it install ... But i love TypeScript!
I will reinstall windows on my main computer soon. If you wish to provide me a step by step installation from vs2013 update 5, i will try it with a fresh install and give you the result to help you improve the installation... If needed ....

tanks for the reply, i will try to remove it on a fresh install to see if it solve the compiles errors.

@mhegazy

This comment has been minimized.

Copy link

commented Apr 11, 2016

there are few issues going on. so let me see if i can break them down.

i have call "tsc -v" and it say 1.0, when i have made "where tsc" it show only the 1.0

The problem is the TS 1.0 installer added itself to the %PATH% environment variable. so when you run tsc --v you are getting this one.

The best way is to edit your path and remove it. See #2068 for more details.

What's strange is one project build but not the other.

New language versions have new features. if you use one of the new features (say from 1.8) on an older compiler (say 1.7), you will get a syntax error, as older versions of the compiler did not understand that syntax.

If your project does not use any new features, then there are no errors, 1.7 code should work on 1.7 and on 1.8, but the opposite is not true.

If i remove the project ts version, it will not be confusing on wish this project is based on?

You can have multiple compiler versions installed on your machine. these are the tools you use to build from MSBuild or through he comandline, i.e, tsc.exe. they all live in C:\Program Files (x86)\Microsoft SDKs\TypeScript. you should file one folder for every version you have installed, e.g. 1.7 and 1.8.

You could chose to "freez" a project to only build against a specif version of the compiler. that is i want this project to always build against TS 1.7. you do this by specifying <TypeScriptToolsVersion>1.7</TypeScriptToolsVersion> in your project file.

if you remove <TypeScriptToolsVersion>, that means you want to build against the latest.

see ToolsVersion documentation at http://www.typescriptlang.org/docs/handbook/compiler-options-in-msbuild.html#ToolsVersion for more details.

now vs2013 generate js file when i save but give compilation error on build.

VS only loads the latest version of the language installed. so if you install TS 1.8, the VS errors you get are for TS 1.8, and not TS 1.7.
Note that you can still build your project against TS 1.7, but VS experience will be out of sync if you use new language features.

If you wish to provide me a step by step installation from vs2013 update 5

It depends on what version of TS you are using for most of your projects. if do not mind, then move all your projects to TS 1.8 by setting <TypeScriptToolsVersion>1.8</TypeScriptToolsVersion> or removing it all together. if you still want to work on TS 1.7, then i would recommend not installing TS 1.8 until you are ready to migrate.

@mhegazy mhegazy added the Question label Apr 11, 2016
@mhegazy mhegazy closed this Apr 11, 2016
@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.
Projects
None yet
3 participants
You can’t perform that action at this time.