我有一个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),另一个用于输出(javascript)。

tsconfig.json:

{
  "compilerOptions": {
...
    "outDir": "out/", 
    "rootDir": "src/", 
...

其他回答

这可能是因为typescript服务器无法找到包含数组所描述的任何文件:

// tsconfig.json
{
  //...
  "include": [
    "./src/"
  ],
}

如果你正在使用VSCode,你可以在编辑器中超级容易地重新启动TS服务器,提示它像这样重新评估文件:

导航到任何.ts或.tsx文件 打开命令面板(CMD + SHIFT + P在mac上) 执行TypeScript: Restart TS server命令:

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

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

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

我得到这个错误:

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

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

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

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

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