简体   繁体   中英

No input was found in config file tsconfig.json

Through npm I have downloaded angular2-highcharts for my application. I just noticed that Visual Studio Code gives me an error in the tsconfig.json file of the package:

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'

I don't really know why I'm getting this error or how to fix it.

Here's the file:

{
  "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
  }
}

Any ideas? Thanks!

The TS compiler want's to have a .ts file in the directory where your tsconfig.json is located. Create an empty file.ts in the same directory and the error should go away.

Generally, if it's an issue with a library, you should:

  • Search the library's issue tracker for similar issues
  • If none are found, create one in accordance with the issue template they provide , giving as much detail as you can about the environment you are compiling in (especially TypeScript, tslint and npm version, and your editor and OS).

That said , their issue template specifically asks that you check here for first, so do wait and see if anyone else answers with a known solution for your case.

You can't really fix it locally because it's in the package's source, so next time you npm install or npm update, your changes will be obliterated.

Of course, if you debug locally and find a solution, I'm sure they would welcome a pull request.

Practically speaking, it sounds like the relative path to the source is incorrect, but it would be astonishing for this to get published. So it might be a bug in VSCode or your linter reporting.

This also assumes you have the most up to date version of the package ( @latest or even @next ).

In my case, I forgot to do this: COPY src/ ./src/ It will copy my src folder. Then after copying, I can now run: RUN yarn install --ignore-engines RUN yarn tsc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM