我已经使用Webstorm 7开发TypeScript已有一段时间了,今天我收到了此错误消息,它阻止Webstorm编译ts文件。有人看过这个问题吗?顺便说一句,我在Mac上。
/usr/local/lib/node_modules/typescript/bin/tsc --sourcemap MyClass.ts --module AMD --target ES5
/usr/local/lib/node_modules/typescript/bin/tsc.js:44963
if (decl.kind == 32 /* DynamicModule */) {
^
TypeError: Cannot read property 'kind' of undefined
at SemanticInfoChain.findDecls (/usr/local/lib/node_modules/typescript/bin/tsc.js:44963:33)
at SemanticInfoChain.findSymbol (/usr/local/lib/node_modules/typescript/bin/tsc.js:45040:30)
at /usr/local/lib/node_modules/typescript/bin/tsc.js:37104:52
at PullTypeResolver.findTypeSymbolForDynamicModule (/usr/local/lib/node_modules/typescript/bin/tsc.js:36426:30)
at PullTypeResolver.resolveImportDeclaration (/usr/local/lib/node_modules/typescript/bin/tsc.js:37103:36)
at PullTypeResolver.resolveAST (/usr/local/lib/node_modules/typescript/bin/tsc.js:39157:33)
at PullTypeResolver.resolveList (/usr/local/lib/node_modules/typescript/bin/tsc.js:38618:26)
at PullTypeResolver.resolveAST (/usr/local/lib/node_modules/typescript/bin/tsc.js:39132:33)
at PullTypeResolver.resolveModuleDeclaration (/usr/local/lib/node_modules/typescript/bin/tsc.js:36610:30)
at PullTypeResolver.resolveAST (/usr/local/lib/node_modules/typescript/bin/tsc.js:39138:33)
最佳答案
确保您具有最新版本的TypeScript。我没有在webstorm中遇到此错误。
PS:您可以尝试使用稍旧的TypeScript版本:
npm install -g typescript@0.9.1
关于compiler-errors - Webstorm 7的TypeScript转码错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19738751/