I am using WebStorm for a node.js application developed using transpiled TypeScript. Whenever I run the tsconfig.json by selecting "compile all" from the TypeScript tab, I get the following error:
Error:Initialization error (typescript). Cannot read property 'getExecutingFilePath' of undefined.
However, if I execute one file at a time I receive "Service is not started".
Here is the tsconfig.json file:
{
"compilerOptions": {
"module": "commonjs",
"target": "ES6",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"types": ["reflect-metadata"],
"lib": ["ES6"],
"sourceMap": true,
"inlineSources": true,
"pretty": true,
"outDir": "dist",
"rootDir": "src",
"noLib": false,
"declaration": true
},
"compileOnSave": true,
"include": [
"src/**/*"
],
"exclude": [
"node_modules"
]
}
Also, I notice that I do not see the TypeScript words at the bottom right of the screen:
I noticed that if I do a tsc --version
from the console, I am getting Version 2.0.2, whereas, if I Preferences -> Languages & Frameworks -> TypeScript
, I am getting 2.6.2 for WebStorm. If I run tsc
from the command line it seems to work but not from within WebStorm. What could be the cause of this issue?
I noticed that if I do a tsc --version from the console, I am getting Version 2.0.2, whereas, if I Preferences -> Languages & Frameworks -> TypeScript, I am getting 2.6.2 for WebStorm
You have TypeScript 2.0.2 installed globally, and 2.6.2 is your local project version. By default, WebStorm uses TypeScript installed in project node_modules.
Most probably, your WebStorm version doesn't support TypeScript 2.6.x (this release includes breaking API changes, so tsserver integration might stop working). Please change TypeScript version to Bundled in Preferences -> Languages & Frameworks -> TypeScript - does it help?