Trying both node
and node --harmony
but I continue to get the \'SyntaxError: Unexpected token import\' error.
I have two files, A.ts<
Try https://www.npmjs.com/package/ts-node. It allows compiling of typescript a la node.
Also make sure your tsconfig.json is set to compile with commonjs. https://github.com/Microsoft/TypeScript/wiki/tsconfig.json
Here is what my tsconfig.json looks like:
{
"version": "1.0",
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"removeComments": true,
"sourceMap": false
}
}
Modules are still in progress, I'm not sure if trying to throw the flag will fix your error but here's the command:
$ node --v8-options | grep 'in progress'
--harmony_modules (enable "harmony modules" (in progress))