I can reproduce your problem when I have a global compiler but not a local one in the ./node_modules
.
In my case compiler just does not know which tsconfig.json file to use. Pointing it to a particular tsconfig.json
file helps:
tsc --project ./tsconfig.json
I have also added dom
option to the lib, because es2017
does not recognize console:
"lib": [
"es2017",
"dom"
]