Problem while using visual studio code with angularjs2 and Typescript 1.5beta.
Error:(3, 1) TS1148: Cannot compile external modules unless the '--module' flag is provided.
Error:(6, 1) TS1205: Decorators are only available when targeting ECMAScript 5 and higher.
I can run the same code using the commandline compiler using tsc -t es5 -m commonjs app.ts.The same problem occours with webstorm 10.0.2 as well.
This is how I solved it in Webstorm/IntelliJ
File>Settings>Languages & Frameworks > TypeScript
Command Line options:
-m amd -t ES5
solved it myself on visual studio code. steps:
1)tsd init
2)tsd query angular --action install --save
3)create tsconfig.json .The configuration file looks something like this
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
}
}
but still dont know how to make it work on webstorm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With