I have written a code typeScript but when I tried executing(tsc filename.ts) it I got an error saying "Cannot find global type 'IterableIterator'". I checked for this on the net and found that the problem was because of the ES5 generators (Check here). I need to create a tsconfig.json file and include a target field in it.
I was wondering if there a way in which I could pass the generators in the command line itself and not make the tsconfig.json?
Yes, all of the compilerOptions that are configurable through a tsconfig.json file are also available at the command line:
https://www.typescriptlang.org/docs/handbook/compiler-options.html
In your specific example, try:
tsc filename.ts --target es5 --downlevelIteration --lib esnext
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With