I can get the AngularJS 2.0 5 Minute Quickstart working in my
IntelliJ IDEA 14.1.4
AngularJS 2.0 Typescript
Error: TS1204: Cannot compile modules into 'commonjs', 'amd', 'system', or 'umd'
when targeting 'ES6' or higher.
Error TS2300: Duplicate identifier 'Promise'
AngularJS 2.0 Quickstart
Okay I've figured out the issues that was preventing me from compiling the
AngularJS 2.0 Quickstart into
EcmaScript 6 :
As basarat mentioned,
ES6 does not support
amd. I did try specifying
--module="system" compiler flag, but that did not work either, still got the error message
Error: TS1204: Cannot compile modules into 'commonjs', 'amd', 'system', or 'umd' when targeting 'ES6' or higher.
The fix for that is to NOT specify any sort of module.
TypeScript compiler options:
--experimentalDecorators --target "es6"
tsd install angular2 es6-promise rx rx-litepulls down ES6 promise, as one would expect. The problem is that
TypeScript 1.5.3includes a
TypeScript Definition filein the
This contains a definition of Promise, which conflicts with the one that was pulled down via the
I removed the
es6-promise directory from my Angular2 project
typings folder (the one that was created by running
(this felt like a hack): I went into the
angular2.d.ts file and removed the following line:
The reason I had to remove this is
AngularJS 2.0 TypeScript Type Definition looks for ES6 Promise at a peer level. Since the
TypeScript compiler (at least the version I am using,
TypeScript 1.5.3 contains the ES6 Promise already) and they conflicted.