Error Message: "error TS6054: File 'app/app.ts.' has an unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.cts', '.d.cts', '.mts', '.d.mts'". The file is in the program because: Root file specified for compilation Found 1 error.
Currently enrolled in a programming course where Typescript is being integrated with Angular. Following the instructions, I installed NodeJS and TSC as requested. For a practice exercise, we were instructed to create an "app.ts" file within an "app" folder in VSC, write a simple "Hello World" program, and compile it using the command "tsc app/app.ts," which should output a new "js" file. Although my first attempt was successful, I encountered this error when redoing the same steps for a new project. The error message mentions an unsupported file extension, despite the fact that ".ts" is a valid extension according to the error itself.
Update: I have double-checked for any typos by trying both "app.ts." and "app.ts," with the latter resulting in the error TS6053: File 'app/app.ts' not found. Interestingly, during my initial attempt, using "tsc app/app.ts." with the period at the end worked flawlessly. Although unconventional for file extensions, the period is essential for file recognition.
Could the issue be related to the file location?
Update: It appears that the problem was indeed a typo. The textbook misled me by including the period at the end of the command. By relocating the TS file to a different directory and running the command without the period from the parent directory, the compilation process was successful. Despite feeling slightly embarrassed, I appreciate the assistance provided. I will repeat the process to confirm that the typo was the root cause, not the file's location within the folder structure.