Reputation: 108
No matter what I do I cannot get the TSC Typescript compiler to find any files. I have tried both the tsc that comes with the Visual Studio Extension and the one that comes from npm. I've tried in the Node.js command line windows shell, and the Git Bash shell. No matter what I do, it just says the file is not found. I've read that the compiler will only work for .ts and .str files, but that does not seem to be the problem.
Here is a quick example of what I'm seeing. I know these files will be empty, but I've tried all of this with files containing code and it doesn't change anything.
C:\>touch test.ts
C:\>ls *.ts
test.ts
C:\>tsc test.ts
Error reading file "test.ts": File not found
C:\>tsc C:\test.ts
Error reading file "C:\test.ts": File not found
C:\>touch test.str
C:\>tsc test.str
Error reading file "test.str": File not found
C:\>tsc ./test.str
Error reading file "./test.str": File not found
C:\>tsc ./test.ts
Error reading file "./test.ts": File not found
C:\>touch test.js.ts
C:\>tsc test.ts
Error reading file "test.ts": File not found
C:\>tsc test.js
Error reading file "test.js": File not found
Upvotes: 4
Views: 3171
Reputation: 953
Looks like a bug in the current compiler [0.8], tsc shouldn't fail on empty files. However
I know these files will be empty, but I've tried all of this with files containing code and it doesn't change anything.
I'm a bit worried about this part. Is that still the case?
Upvotes: 1
Reputation: 8074
That's difficult to debug from afar. The typescript compiler does quite a lot of processing until it resolves a file.
What's the output of running
tsc -debug test.ts
? Also, please make sure that test.ts is non-empty.
Upvotes: 0