I started to study Angular, but i can't get trough the problem with convert typescript file to javascript. I've created AngularCLI project and simple typescript file:
class Example {
msg = 'Some message';
}
and i tried to convert it to js with tsc command: tsc example.tsc. This is javascript file which was generated:
var Example = /** @class */ (function () {
function Example() {
this.msg = 'Some message';
}
return Example;
}());
And i've got some errors
node_modules/@types/selenium-webdriver/remote.d.ts:139:29 - error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.
I think (or even sure) the problem is in javascript version (even error says that). This is tsconfig.json file:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}
}
So i did what was suggested. I changed module, target, lib to atleast es2015 ( everything together and each separately) - it didnt help. I tried a lot of solutions from SO, jetbrain forum etc but nothing worked for me.
I use webstorm 2018.3 version. Node version is 10.14.1. Tsc version is 3.1.6.