tsconfig.json:构建:在配置文件中找不到输入

新手上路,请多包涵

我有一个 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/*"
  ]
}

这是一个错误还是我做错了什么?我最近确实将 Visual Studio 2015 升级到更新 3。以前有人遇到过这种情况吗?

原文由 rood 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.4k
2 个回答

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

原文由 rood 发布,翻译遵循 CC BY-SA 4.0 许可协议

将一个 .ts 文件添加到您的项目根目录(与 .tsconfig 文件相同的级别)。

所以就我而言,我添加了一个 .ts 文件并将其命名为: main.ts

在我的 .tsconfig 文件中,我包含 了 main.ts

 {
  "include": ["src/**/*", "main.ts"]
}

原文由 Tri Dawn 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进