我有一个ASP。NET核心项目,我得到这个错误时,我试图构建它:

error TS18003: Build:No inputs were found in config file 'Z:/Projects/client/ZV/src/ZV/Scripts/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["../wwwroot/app","node_modules/*"]'.
1>         The command exited with code 1.
1>       Done executing task "VsTsc" -- FAILED.

这是我的tsconfig。json文件:

{
  "compileOnSave": true,
  "compilerOptions": {
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [ "es5", "dom" ],
    "module": "commonjs",
    "moduleResolution": "node",
    "noEmitOnError": true,
    "noImplicitAny": false,
    "outDir": "../wwwroot/app/",
    "removeComments": false,
    "sourceMap": true,
    "target": "es6"
  },
  "exclude": [
    "../wwwroot/app",
    "node_modules/*"
  ]
}

这是bug还是我做错了什么?我最近把Visual Studio 2015升级到3。有人以前遇到过这种情况吗?


当前回答

我在根目录(visual studio)中添加了以下内容

{
  "compilerOptions": {
    "allowJs": true,
    "noEmit": true,
    "module": "system",
    "noImplicitAny": true,
    "removeComments": true,
    "preserveConstEnums": true,
    "sourceMap": true
  },
  "include": [
    "**/*"
  ],
  "exclude": [
    "assets",
    "node_modules",
    "bower_components",
    "jspm_packages"
  ],
  "typeAcquisition": {
    "enable": true
  }
}

其他回答

将一个空的typescript文件添加到typescript scripts文件夹(tsconfig文件的位置),以满足typescript编译器的要求。

我的解决方案中有4个现有项目的现有tsconfig文件。升级到vs2017后,我遇到了这个问题。正如NicoJuicy所描述的那样,通过向文件添加包含和排除部分(假设是默认的)来修复。

当使用Visual Studio Code构建项目时(即按Ctrl + Shift + B),将.ts文件移动到.vscode文件夹中(我不知道为什么它这样做),然后生成TS18003错误。 我所做的就是将我的.ts文件从.vscode文件夹中移出,回到根文件夹中,并再次构建项目。

项目构建成功!

我得到这个错误:

在配置文件“tsconfig.json”中没有发现输入。

包括指定的路径是 '["**/*"]' 和排除路径”(“* * / * .spec.ts”、“app_ / * * / * .ts”、“* * / * .d.ts”、“node_modules”)”。

我有一个.tsconfig文件,它从。/src文件夹读取TS文件。

这里的问题是,源文件夹不包含任何.ts文件,我正在运行tslint。我通过从gulp文件中删除tslint任务来解决这个问题,因为我没有任何.ts文件需要编译和检测。

对我来说,解决方案是将文件夹传递到本地磁盘,在我将文件夹复制到谷歌驱动器存储库(g:/)。当拷贝回来的时候,所有工作都很好。