为什么打字稿不断给我,在配置文件错误中找不到输入?
Typescript为什么会继续给我在Config File
错误中找不到输入?
当我在VS代码中使用tsconfig.json
时,但是当我尝试构建它时,它会给我错误。
终端:
error TS18003: No inputs were found in config file '/Users/user/Desktop/projects/ts/.vscode/tsconfig.json'.
Specified 'include' paths were '["/Users/user/Desktop/projects/ts/mathweb/app.ts"]' and 'exclude' paths were '["/Users/user/Desktop/projects/ts/mathweb/app.ts"]'.
Found 1 error.
The terminal process "zsh '-c', 'tsc -p /Users/user/Desktop/projects/ts/.vscode/tsconfig.json'" failed to launch (exit code: 2).
Terminal will be reused by tasks, press any key to close it.
但行不通。其他答案告诉我在tsconfig.json上使用rootdir,我做到了,而且也行不通。
这让我感到困惑。我不熟悉打字稿,我只想将TS编译到指定的目录,这就是现在发生的事情。
我正在使用VSCODE IDE,我不确定这是IDE的问题,还是我的错
Tsconfig.json:
{
"compilerOptions": {
"outDir": "/Users/user/Desktop/projects/ts/mathweb/app.ts",
"rootDir": "./mathweb"
},
"include": [
"/Users/user/Desktop/projects/ts/mathweb/app.ts"
]
,
"exclude": [
"/Users/user/Desktop/projects/ts/mathweb/app.ts"
]
}
Why does typescript keep giving me the No inputs were found in config file
error?
When I use tsconfig.json
in VS Code, but when I try to build it, it gives me the error.
Terminal:
error TS18003: No inputs were found in config file '/Users/user/Desktop/projects/ts/.vscode/tsconfig.json'.
Specified 'include' paths were '["/Users/user/Desktop/projects/ts/mathweb/app.ts"]' and 'exclude' paths were '["/Users/user/Desktop/projects/ts/mathweb/app.ts"]'.
Found 1 error.
The terminal process "zsh '-c', 'tsc -p /Users/user/Desktop/projects/ts/.vscode/tsconfig.json'" failed to launch (exit code: 2).
Terminal will be reused by tasks, press any key to close it.
And I search on SO, and some answer told me to create a empty file, so I did:
But it doesn't work. Other answer told me to use rootDir at tsconfig.json, and I did, and also doesn't work.
It make me confused. I'm not familiar with typescript and I just want ts compile to specified directory, and that is what happened right now.
I'm using vscode ide, I'm not sure if that is IDE's problem,or could also be my fault
tsconfig.json:
{
"compilerOptions": {
"outDir": "/Users/user/Desktop/projects/ts/mathweb/app.ts",
"rootDir": "./mathweb"
},
"include": [
"/Users/user/Desktop/projects/ts/mathweb/app.ts"
]
,
"exclude": [
"/Users/user/Desktop/projects/ts/mathweb/app.ts"
]
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
包括期望相对路径so so so so so so so so so
so you n excrude编辑 中添加了app.ts。
尝试一下
include expects relative path so and you added app.ts in exclude
Edit: as you don't have tsconfig on root dir
try this
对我而言,我只是关闭“ VS代码编辑器”并重新打开它,并且可以使用&错误已经消失了!!!
For me, I just close the "VS Code Editor" and Re-open it, And It's worked & the error has gone!!!