1

I have VS 2013 Update 4 and I am trying out TS for the first time.

I can't the compiler to do its job, I get a 'Command "tsc" is not valid' error in the Command Window.

I have verified that I did have the correct PATH entry and that it pointed to the correct location for tsc.exe. I have tried closing/opening the command window and restarting VS as others have suggested.

Automatic TS compiling is also not working. I have tried excluding and re-adding the .ts file and turning on compile module not part of project.

Any ideas what else I can try?

Edit: Automatic compilation is actually working. I was assuming that the resulting js file would show up in the project tree so I could add it to my html. It does not. The .js file is created, even if you see no evidence within VS. If you drag the .ts file into your code window, it actually adds the .js file.

4
  • Do you have a file named tsc in the project folder? Commented Jul 14, 2015 at 18:34
  • Try to reinstall: visualstudiogallery.msdn.microsoft.com/… Commented Jul 14, 2015 at 18:34
  • @Ryan, No such file. Commented Jul 14, 2015 at 20:56
  • @fals, That got me 1.5, good, but did not solve the problem. Note for others - upgrading from 1.0 to 1.5 does not change the PATH variable - you need to do this manually. Turns out auto compile was working, see my edit. Commented Jul 14, 2015 at 20:56

1 Answer 1

2

There are a few interesting points to note...

Check your PATH... I know you already did this, because you mention it in your question, but really double check it. Manually browser to c:\Program Files (x86)\Microsoft SDKs\TypeScript\ and see what your most recent version is. Then check that your PATH variable points to that folder. You sometimes have to restart to get the PATH variable refreshed everywhere it gets used.

Don't expect to find JavaScript files in Visual Studio. This has been the case since v0.9.5. They are like DLLs - you don't browse them, edit them, or check them into version control.

Still a problem? Open a command prompt (in the solution context) and try tsc -v. This not only checks your PATH is right, it will tell you which version it is pointing to. Maybe you still have the old path to tsc as well as the new one in your PATH variable.

Sign up to request clarification or add additional context in comments.

1 Comment

Well, I went back to this and figured out that it DOES work from an OS command window but NOT from the VS command window . Stupid me, I was using the command window within the obvious context of my IDE. But really, this makes perfect sense that I should not need to go outside of my IDE to manually run the compiler, or is there something actually wrong and I should still be able to do that?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.