我有一个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。有人以前遇到过这种情况吗?


当前回答

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

其他回答

在'include'标签中添加.ts文件位置,然后编译工作正常。前女友。

"include": [
"wwwroot/**/*" ]

我得到这个错误:

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

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

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

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

当您创建tsconfig。Json文件的TSC——init,然后注释输入和输出文件目录。这就是错误的根本原因。

要解决这个问题,取消注释这两行:

"outDir": "./", 
"rootDir": "./", 

在取消注释后,它最初看起来像上图。

但是我所有的。ts脚本都在src文件夹中。我指定了/src。

"outDir": "./scripts", 
"rootDir": "./src", 

请注意,您需要在rootDir中指定.ts脚本的位置。

当我在同一目录下对node_modules文件夹进行备份时,我收到了同样的错误。当发生这种情况时,我正在尝试解决一个不同的构建错误。我希望这个场景能帮助到一些人。删除备份文件夹,构建将完成。

我在根目录(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
  }
}