配置文件tsconfig.json中未找到任何输入

时间:2017-11-09 15:13:58

标签: json angular typescript angular2-highcharts

通过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
  }
}

有什么想法吗?谢谢!

3 个答案:

答案 0 :(得分:0)

通常,如果它是库的问题,您应该:

  • 搜索the library's issue tracker以查找类似问题
  • 如果没有找到,create one 根据他们提供的问题模板,尽可能详细地说明您正在编译的环境(特别是TypeScript,tslint和npm)版本,编辑器和操作系统)。

那说,他们的问题模板明确要求您首先在这里查看,所以请等一下,看看是否还有其他人用你的案例的已知解决方案回答。

您无法在本地修复它,因为它位于软件包的源代码中,因此下次npm install或npm update时,您的更改将被删除。

当然,如果您在本地调试并找到解决方案,我相信他们会欢迎拉取请求。

实际上,这听起来像源的相对路径是不正确的,但是发布它会令人惊讶。所以它可能是VSCode或你的linter报告中的一个错误。

这也假设您拥有最新版本的软件包(@latest甚至@next)。

答案 1 :(得分:0)

TS编译器希望在tsconfig.json所在的目录中有一个.ts文件。 在同一目录中创建一个空的file.ts,错误应该消失。

答案 2 :(得分:0)

就我而言,我忘了这样做: COPY src/ ./src/ 它将复制我的 src 文件夹。然后复制后,我现在可以运行: RUN yarn install --ignore-engines RUN yarn tsc

相关问题