8

I installed the TSC with NPM yesterday and when I download the last Typescript definitions from the repository with tsd@0.5.7 and I proceed to compile my code I got a lot of compile errors from the definitions. The only way that I have found to fix this kind of errors is going back to definitions for the typescript 1.3, Do you have an idea why this is happening?

Update 1 I installed the tsc for my mac (the installation mentioned before was in Windows) and when I run tsc --version I got different results, even if both of they say they are 1.4.1


Windows: Console on Windows


Mac Console on Mac

dante_dubon
  • 305
  • 1
  • 6

3 Answers3

11

Probably your PATH environment variable is wrong, you can check that by executing echo %PATH% and you will probably see something like C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\; there before the roaming npm path.

You can change that by going to the Control Panel -> System & Security -> and on the left there is "Advanced System settings", click on It and a popup will open. Chose the tab "advanced" there and click the button "Environment variables", there you can change your path.

Reopen your command prompt (MSys on the look of your screenshot) or the change wont have any effect.

I hope the names are right, because I'm currently on a Dutch Windows version. If you have any problems please let me know :)

Dick van den Brink
  • 13,690
  • 3
  • 32
  • 43
  • Thank you very much, This solved my problem, But, this situation happened on a fresh new installation of Node and tsc, using npm. I only had VS2013 before, this could be an error from the package on npm? Again thanks a lot. – dante_dubon Feb 28 '15 at 18:47
  • 2
    The problem was that VS2013 also has a copy of Typescript and that one was having precedence over the NPM version because of the Windows environment PATH variable. So, it wasn't an error of the npm package or VS2013, It is just how windows searches the PATH and the environment variable order. Glad it worked for you! :) – Dick van den Brink Feb 28 '15 at 19:02
1

I rename the path of the 1.0 version to 1.0.1 and when I type tsc -v the result was 1.4.0.0

I changed from :

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

To:

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

And it worked.

0

I installed the TSC with NPM yesterday and when I download the last Typescript definitions from the repository with tsd@0.5.7 and I proceed to compile my code I got a lot of compile errors from the definitions

Not possible if tsc is pointing to typescript@1.4.1. Run where tsc (windows) or which tsc (unix) or tsc --version. If it ain't the right version, then you have your answer. The following shows one error scenario:

enter image description here

basarat
  • 261,912
  • 58
  • 460
  • 511