gpt4 book ai didi

Angular5 - TypeScript 编译中缺少文件

转载 作者:太空狗 更新时间:2023-10-29 17:27:59 27 4
gpt4 key购买 nike

我有一个 file.ts 文件,它不包含组件/服务/等,只包含数据类型。

When I try to compile my program I get this error: Module build failed: Error: my path\File.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.

然后我更改了我的 tsconfig.app.json 文件以包含 include 标记:

{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"include": [
"**/*.ts"
],
"exclude": [
"**/*.spec.ts"
]
}

正如消息所建议的那样,但我得到了这个错误:

error TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["src/**/*.ts"]' and 'exclude' paths were '["**/*.spec.ts"]'.

我做错了什么?

最佳答案

为了达到预期的结果,请使用正确的路径和文件夹名称,因为一切看起来都很好

POST中提到的错误是由于路径

另一种选择是使用文件

"files": [ 
"file.ts"]

在 tsconfig.json 中

查看此链接了解更多详情- https://github.com/angular/angular/issues/20091

关于Angular5 - TypeScript 编译中缺少文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49953634/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com