Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error TS6044: Compiler option 'types' expects an argument

i'm facing with the following error error TS6044: Compiler option 'types' expects an argument. when trying to set "types": [] in tsconfig.json.

We are using grunt-ts

This is recommended by official TS documentation in order to get rid of the following errors: node_modules/@types/angular/index.d.ts(14,9): error TS2403

Here is the link to TS documentation

Specify "types": [] to disable automatic inclusion of @types packages.

But instead of disabling automatic inclusion of @types i see error error TS6044: Compiler option 'types' expects an argument.

Can someone help me?

like image 423
VladosJS Avatar asked Jun 29 '17 08:06

VladosJS


People also ask

What does the TSC command do?

The tsc command envokes the TypeScript compiler. When no command-line options are present, this command looks for the tsconfig. json file. If no tsconfig.

Where does TSC compile to?

By default, TS compiler outputs transpiled files to the same directory where the original TS files is found. However, this can be changed using outDir compiler option. Now, when we run tsc all output will copied into dist folder preserving the original directory structure.


1 Answers

I would recommend using tsconfig.json passthrough with that parameter and grunt-ts. Several of the new features in the TypeScript 2.x timeframe don't work very well or at all from the command-line. Alternatively, you could try using the additionalFlags feature of grunt-ts and pass "" as the types value. I'm not near a computer to test that, but it could work.

like image 84
NYCdotNet Avatar answered Sep 20 '22 13:09

NYCdotNet