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


当前回答

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

其他回答

你需要有根索引。TSX或指数。Ts文件使TSC命令工作。

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

如果你正在使用vs代码进行编辑,那么尝试重新启动编辑器。这个场景解决了我的问题。我认为这是编辑器缓存的问题。

对于遇到相同错误的任何人,都应该尝试将“node modules”添加到排除选项中

{
   "compilerOptions": {
     ...
   },
   "include": [
      "./src/**/*.ts"
   ],
   "exclude": [
      "./out.d.ts",
      "node_modules",
   ]
}

如果你正在使用VSCode,并且你打开了几个文件夹,那么你需要打开你正在工作的一个文件夹,让它消失。

错误打开文件夹 文件夹右打开