I am encountering an issue while compiling my TypeScript file:
app/app.component.ts
import {Component} from 'angular2/core';
@Component({
selector: 'my-app',
template: '<h1>Messenger</h1>'
})
export class AppComponent { }
The TypeScript Compiler is generating the following errors:
Error:(1, 1) TS1148: Cannot compile modules unless the '--module' flag is provided.
Error:(1, 25) TS2307: Cannot find module 'angular2/core'.
Error:(7, 14) TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning.
Even after specifying flags in tsconfig.json, the issue persists.
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}
My project structure:
.
├── app
├── node_modules
├── typings
├── application.js
├── messages.js
├── package.json
├── tsconfig.json
└── typings.json
I'm using RubyMine 8 IDE.
Could you please guide me on what I might be doing wrong? Is there an alternative way to set these flags?