I have a simple node program with an import
import { y } from './y';
console.log('Y=');
console.log(y);
Doesn't really matter, important is that I have an import and a console.log. Now when I try to run this code
$> ts-node test.ts
import { y } from './y';
SyntaxError: Unexpected token {
...
I get an error. So, without any additional information ts-node doesn't understand import. So I created the following tsconfig.json
{
"compilerOptions": {
"target": "ES2017",
"module": "ESNext"
}
}
Now it doesn't throw the import error, but I also don't see any output from the program too.
I get the feeling my tsconfig.json is just wrong, any suggestion what might be the case?