简体   繁体   English

在Visual Studio Code IDE中编译.ts文件时,无法读取未定义错误的属性'args'

[英]Cannot read property 'args' of undefined error while compiling a .ts file in Visual Studio Code IDE

I have written a tsconfig.json file which contains, 我写了一个包含的tsconfig.json文件,

{
    "compilerOptions": {
        "target": "es5"
    }
}

And my HelloWorld.ts file contains, 我的HelloWorld.ts文件包含,

function SayHello() {
    let x = "Hello World!";
    alert(x);
}

But, when I compile this code in Visual Studio Code using Ctrl + Shift + B I'm receiving the below error (in the output window), 但是,当我使用Ctrl + Shift + B在Visual Studio代码中编译此代码时,我收到以下错误(在输出窗口中),

Cannot read property 'args' of undefined

My NodeJS Version is 7.8.0, and TypeScript version is 2.3.4 我的NodeJS版本是7.8.0,TypeScript版本是2.3.4

Can someone help what's going wrong here? 有人可以帮助解决这里出了什么问题吗?

I have solved it,This url provides a reliable answer. 我已经解决了,这个网址提供了一个可靠的答案。 url: https://github.com/Microsoft/TypeScript/issues/16850 . 网址: https//github.com/Microsoft/TypeScript/issues/16850

This might actually be an issue with Visual Studio Code integration, You can try to open the command panel and try typing "configure task runner" and select "TypeScript-tsconfig.json" .Then vscode will automatically generate a .vscode folder under the current Project and generate the following tasks.json file. 这可能是Visual Studio Code集成的一个问题,您可以尝试打开命令面板并尝试键入“configure task runner”并选择“TypeScript-tsconfig.json”。然后vscode将自动生成当前的.vscode文件夹项目并生成以下tasks.json文件。

{
  "version": "0.1.0",
  "command": "tsc",
  "isShellCommand": true,
  "showOutput": "always"
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Typescript-在Visual Studio代码中编译.ts文件时出错 - Typescript - Error while compiling a .ts file in visual studio code 错误:“类型”只能在 a.ts 文件中使用 - 使用 @ts-check 的 Visual Studio 代码 - Error: 'types' can only be used in a .ts file - Visual Studio Code using @ts-check TypeError: Cannot read property 'then' of undefined -- 在使用 then 时出现此错误 - TypeError: Cannot read property 'then' of undefined --got this error while using then 错误:“无法读取未定义的属性 'nodename'” 转换 html 表时 - Error : “cannot read property 'nodename' of undefined” While converting html Table 在 Parcel React 上无法读取未定义错误的属性“类型” - Cannot read property 'type' of undefined error while on Parcel React 加载路线时出错,无法读取未定义的属性 - error while loading route, cannot read property of undefined 设置变体选项数组时出错无法读取未定义的属性“0” - error while setting variants option array Cannot read property '0' of undefined 加载数据时出错 TypeError:无法读取未定义的属性“管道” - Error while loading the data TypeError: Cannot read property 'pipe' of undefined 使用Fetch API时无法读取未定义错误的属性 - Cannot read property then of undefined error while using Fetch API 单元测试时出错 - TypeError:无法读取未定义的属性'cityWeather' - Error while unit test - TypeError: Cannot read property 'cityWeather' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM