Compile problems with npm typescript @ 1.4.1 on Windows

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

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


Window: Console on Windows


Mac Console on Mac

+7
npm typescript definitelytyped tsd
source share
3 answers

Your PATH environment variable is probably incorrect, you can verify this by running echo %PATH% and you will probably see something like C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\; before npm roaming.

You can change this by going to Control Panel โ†’ System and Security โ†’, and on the left โ€œAdvanced System Settingsโ€, click โ€œAndโ€, and a pop-up window will open. Select the "Advanced" tab and click the "Environment Variables" button, there you can change your path.

Re-run your command prompt (MSys in the view of your screenshot) or the change will have no effect.

I hope the names are correct, because I am now on the Dutch version of Windows. If you have any problems, let me know :)

+11
source share

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

I changed from:

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

To:

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

And it worked.

+1
source share

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

It is impossible if tsc points to typescript@1.4.1 . Run where tsc (windows) or which tsc (unix) or tsc --version . If this is not the correct version, you have your answer. The following is one error scenario:

enter image description here

0
source share

All Articles