I had similar problem. I have quite some to share with my findings. I'm working on Angular 2 too (ng-book-2).
What am I using?
IDE: WebStorm
Typescript: 1.6.2
When: 10 Oct 2015
What am I doing?
I tried compiling my app.ts to app.js; however, I encounter this error:
error TS5052: Option 'emitDecoratorMetadata' cannot be specified without specifying option 'experimentalDecorators'.
This was my tsconfig.json BEFORE
{
"version": "1.5.0",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true
},
"filesGlob": [
"./**/*.ts",
"!./node_modules/**/*.ts"
],
"files": [
"./app.ts",
"./typings/angular2/angular2.d.ts",
"./typings/es6-promise/es6-promise.d.ts",
"./typings/rx/rx-lite.d.ts",
"./typings/rx/rx.d.ts",
"./typings/tsd.d.ts"
]
}
This is my tsconfig.json AFTER
{
"version": "1.6.2",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
"filesGlob": [
"./**/*.ts",
"!./node_modules/**/*.ts"
],
"files": [
"./app.ts",
"./typings/angular2/angular2.d.ts"
]
}
Changing the tsconfig.json from before to after effectively solves two problems of mine. One is the above and the other is the below problem. The latter problem is discussed here angular2 with ES6 should not reference es6-promise
typings/es6-promise/es6-promise.d.ts(11,15): error TS2300: Duplicate identifier 'Promise'.
typings/es6-promise/es6-promise.d.ts(42,16): error TS2300: Duplicate identifier 'Promise'.
typings/es6-shim/es6-shim.d.ts(475,11): error TS2300: Duplicate identifier 'Promise'.
typings/es6-shim/es6-shim.d.ts(552,13): error TS2300: Duplicate identifier 'Promise'.