通过npm,我为我的应用程序下载了angular2-highcharts。我刚刚注意到Visual Studio Code在包的tsconfig.json文件中给了我一个错误:
file: 'file:///c%3A/pdws-view-v2/node_modules/angular2-highcharts/tsconfig.json'
severity: 'Error'
message: 'No inputs were found in config file 'c:/pdws-view-v2/node_modules/angular2-highcharts/tsconfig.json'. Specified 'include' paths were '["src/**/*"]' and 'exclude' paths were '["examples","index.d.ts","node_modules","dist"]'.'
at: '1,1'
source: 'ts'我真的不知道为什么会出现这个错误,也不知道如何修复。
这是文件:
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"removeComments": true,
"sourceMap": true,
"outDir": "dist",
"declarationDir": "dist",
"declaration": true
},
"compileOnSave": true,
"include": [
"src/**/*"
],
"exclude": [
"examples",
"index.d.ts",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"genDir": "dist/",
"strictMetadataEmit": true,
"skipTemplateCodegen": true
}
}有什么想法吗?谢谢!
发布于 2019-01-15 19:44:35
TS编译器希望在您的tsconfig.json所在的目录中有一个.ts文件。在同一目录中创建一个空的file.ts,错误就会消失。
发布于 2017-11-09 23:28:10
一般来说,如果这是一个库的问题,你应该:
说,他们的问题模板特别要求您先在这里检查angular2-highcharts,所以请耐心等待,看看是否有人为您的情况提供了已知的解决方案。
你不能真的在本地修复它,因为它在包的源代码中,所以下次你安装npm或npm更新时,你所做的更改将被删除。
当然,如果您在本地调试并找到解决方案,我相信他们会欢迎pull请求。
实际上,到源代码的相对路径听起来是不正确的,但如果这篇文章发表了,那将是令人惊讶的。因此,这可能是VSCode或您的linter报告中的错误。
这还假设您拥有最新版本的包(@latest甚至是@next)。
发布于 2021-04-14 03:42:50
在我的例子中,我忘记了这样做:COPY src/ ./src/它将复制我的src文件夹。然后,在复制之后,我现在可以运行:RUN yarn install --ignore-engines RUN yarn tsc
https://stackoverflow.com/questions/47205322
复制相似问题