I’m trying to compile a typescript into JavaScript using tsc node package module. First of all, I’ve installed the module using npm install -g typescript.
In my local directory I’ve created a file called classes.js containing a valid typescript code. When running tsc classes.js I get the following error: Error reading file "./classes.js": File not found
The error doesn’t make much sense, since the file exist. Same error is shown when the absolute file path is used. I’m wondering if there is something wrong with tsc module or am I missing something?
The typescript compiler specifically looks for extensions
.strand.ts. Here is the code that resolves input file names:The compiler then looks for a file with name
normalizedPath, which in your case corresponds toclasses.js.ts, which does not exist. In my opinion, the compiler should output a better error message here.