compiler-errors - Webstorm 7的TypeScript转码错误

标签 compiler-errors typescript code-translation

我已经使用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/

相关文章:

c++ - 错误C2440 : 'return' cannot convert from 'const bool' to 'const bool*'

c# - "Cartiesian Product"C++ 方法

c++ - 尝试在MSYS2/MinGW-w64上编译时,许多内部标准库会编译错误

typescript - 返回的表达式类型 Child 不能分配给类型 Parent

javascript - Angular 2 : Promise rejection: alertify is not defined

node.js - 如何在 typescript 中使用 yargs 解析命令行参数

python - 系统 ('hostname' ) 从 MATLAB 到 Python

Haskell 函数到 Clojure 函数的转换

compiler-errors - 如何在Travis CI容器中安装具有webp支持的较新imagemagick?

C++ 使用 GetEnvironmentVariable() 的完整路径写入文件错误