我写了一个tsconfig.json
文件,其中包含
{
"compilerOptions": {
"target": "es5"
}
}
我的HelloWorld.ts
文件包含
function SayHello() {
let x = "Hello World!";
alert(x);
}
但是,当我使用 Ctrl + Shift + B 在Visual Studio代码中编译此代码时,我收到以下错误(在输出窗口),
Cannot read property 'args' of undefined
我的NodeJS版本是7.8.0,TypeScript版本是2.3.4
有人可以帮助解决这里出了什么问题吗?
答案 0 :(得分:1)
我已经解决了,这个网址提供了可靠的答案。 地址:https://github.com/Microsoft/TypeScript/issues/16850
这可能是Visual Studio Code集成的一个问题,您可以尝试打开命令面板并尝试键入" configure task runner"并选择" TypeScript-tsconfig.json"然后vscode将在当前Project下自动生成一个.vscode文件夹,并生成以下tasks.json文件。
{
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"showOutput": "always"
}