1

我用 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)
4

1 回答 1

0

确保您拥有最新版本的 TypeScript。我没有遇到过 webstorm 的这个错误。

PS:您可以尝试使用稍旧的 TypeScript 版本:

npm install -g  typescript@0.9.1
于 2013-11-02T04:46:24.293 回答