Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeScript TS6053: File ' .ts' not found

I'm getting this error

error TS6053: File 'xxx.ts' not found.

but the files compiles fine yesterday, but today no, after reviewing, I made this simple test

class HelloWorld {

    public static main(): number{

    return 0;    
    }
}
HelloWorld.main();

but I get the same error, anyone know the reason for this or may be the error

error TS6053: File 'HelloWorld.ts' not found.

https://github.com/Microsoft/TypeScript/blob/v1.6.2/src/compiler/diagnosticMessages.json#L2205


UPDATE:

Closing the ide, and open the error does not solve everything was the same.

Opened the ide,

file > folder close

file > open folder > your folder

this fix the error.

like image 829
Angel Angel Avatar asked Mar 09 '16 14:03

Angel Angel


2 Answers

I got this "TS6053" error because Visual Studio 2017 didn't find a folder I added to a Angularjs project.

The solution posted above by Angel Angel to restart the IDE (or Visual Studio) in my case) fixed the issue.

Hopefully this answer can help someone who's googling for the error and visual studio. I'll also include the entire error message to catch searches for the same error.

Severity Code Description Project File Line Suppression State Error TS6053 File 'C:/Users/.../my_project/node_modules/xlsx/types' not found. my_project JavaScript Content Files 1 Active

Closing and opening Visual Studio fixed my issue. Thanks to Angel Angel

like image 183
Emanuel Lindström Avatar answered Nov 10 '22 20:11

Emanuel Lindström


The main reason of this error is to running TypeScript file compile command in a wrong directory.

Superpose I have crated a app.kironTest.ts file under src folder so I should write following command to run my app.kironTest.ts file as my file name is app.kironTest.ts. under src directory.

tsc .\app\app.kironTest.ts

Above command run successfully.

But If you command like below:

app.kironTest.ts

You would get following error

enter image description here

Correct Command would be:

tsc .\app\app.kironTest.ts
like image 1
Md Farid Uddin Kiron Avatar answered Nov 10 '22 21:11

Md Farid Uddin Kiron