Node is able to run the following without errors (node hello-world.ts):
var f = () => {
console.log('Hello World!');
};
f();
However, when I try this file:
interface Accountable {
getIncome() : number;
}
I get get the following exception:
interface Accountable {
^^^^^^^^^^^
SyntaxError: Unexpected identifier
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
I've tried adding --target ES5 and ES2015 to the TSC settings page, but no effect.
node filename.ts..tsfiles from the command line without transpiling, you can use ts-node