项目场景:
使用vscode编写ts
问题描述
在使用vscode运行监控ts文件自动编译生成js时报错无法启动,显示
error TS5058: The specified path does not exist: 'd:\tyy\axios\typescript\day02\..\..\..\..\..\D:\tyy\axios\typescript\day02\tsconfig.json'.
解决方案:
点击vscode终端运行任务=》显示所有任务=》tsc监视设置=》在tasks.json中写入下列代码
{
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
],
"group": "build",
"label": "tsc: 监视 - tsconfig.json"
}
]
}
重启tsc监视 运行成功