I have an ASP.NET core project and I'm getting this error when I try to build it:
我有一个ASP。NET core项目,当我尝试构建它时,我得到了这个错误:
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.
This is my tsconfig.json
file:
这是我的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/*"
]
}
Is this a bug or am I doing something wrong? I did recently upgrade Visual Studio 2015 to update 3. Has anyone encountered this before?
这是bug还是我做错了什么?我最近更新了Visual Studio 2015更新3。以前有人遇到过这种情况吗?
8 个解决方案
#1
96
Added an empty ts file to the Scripts folder and project did compile.
将一个空的ts文件添加到脚本文件夹,并进行了编译。
#2
6
I'm not using TypeScript in this project at all so it's quite frustrating having to deal with this. I fixed this by adding a tsconfig.json and an empty file.ts file to the project root. The tsconfig.json contains this:
我在这个项目中根本没有使用打字稿,所以不得不处理这个非常令人沮丧。我通过添加tsconfig解决了这个问题。json和一个空文件。ts文件到项目根目录。tsconfig。json:包含
{
"compilerOptions": {
"allowJs": false,
"noEmit": true // Do not compile the JS (or TS) files in this project on build
},
"compileOnSave": false,
"exclude": [ "src", "wwwroot" ],
"include": [ "file.ts" ]
}
#3
3
When using Visual Studio Code, building the project (i.e. pressing Ctrl + Shift + B), moves your .ts file into the .vscode folder (I don't know why it does this), then generates the TS18003 error. What I did was move my .ts file out of the .vscode folder, back into the root folder and build the project again.
使用Visual Studio代码时,构建项目(即按Ctrl + Shift + B),将.ts文件移动到.vscode文件夹中(我不知道为什么会这样),然后生成TS18003错误。我所做的就是将我的.ts文件从.vscode文件夹中移回根文件夹,并再次构建项目。
The project built successfully!
项目成功了!
#4
2
I am getting this error, "No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["/"]' and 'exclude' paths were '["/.spec.ts","app_//.ts","/.d.ts","node_modules"]'."
我得到了这个错误,“在配置文件‘tsconfig.json’中没有发现输入。指定”包括“路径”(“/”)和“排除”路径是“(“/ .spec.ts”、“app_ / / .ts”、“/ .d.ts”、“node_modules”)的。”
I have a .tsconfig file, which reads ts files from "./src" folder.
我有一个.tsconfig文件,它从“”中读取ts文件。/ src文件夹。
The issue here is with that source folder not containing .ts files and i am running tslint. I resolved issue by removing tslint task from my gulp file. As i don't have any .ts files to be compiled and linted. My issue is resolved by doing this.
这里的问题是源文件夹不包含.ts文件,我正在运行tslint。我通过从gulp文件中删除tslint任务来解决这个问题。因为我没有任何.ts文件需要编译和连接。通过这样做,我的问题得到了解决。
#5
2
add .ts file location in 'include' tag then compile work fine. ex.
在“include”标签中添加.ts文件位置,然后编译工作。前女友。
"include": [
"wwwroot/**/*" ]
#6
1
I had existing tsconfig files for 4 existing projects in my solution. After upgrading to vs2017 I experienced this problem. It was fixed by adding the (supposedly default) include and exclude sections to the files, as described by NicoJuicy.
我的解决方案中有4个现有项目的tsconfig文件。升级到vs2017后,我遇到了这个问题。它是通过添加(应该是默认的)包含和排除部分到文件来修复的,如NicoJuicy所描述的。
#7
0
Btw, just had the same problem.
顺便说一下,也有同样的问题。
If you had my case, then you probably have the tsconfig.json not in the same directory as the .ts file.
如果你有我的箱子,那么你可能有tsconfig。json不在.ts文件所在的目录中。
(In my case I stupidly had next to launch.json and tasks.json inside the .vscode folder :P)
(在我的情况下,我愚蠢地选择了下一次发射。json和任务。.vscode文件夹中的json:P)
#8
0
I added the following in the root ( visual studio )
我在根(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
}
}
#1
96
Added an empty ts file to the Scripts folder and project did compile.
将一个空的ts文件添加到脚本文件夹,并进行了编译。
#2
6
I'm not using TypeScript in this project at all so it's quite frustrating having to deal with this. I fixed this by adding a tsconfig.json and an empty file.ts file to the project root. The tsconfig.json contains this:
我在这个项目中根本没有使用打字稿,所以不得不处理这个非常令人沮丧。我通过添加tsconfig解决了这个问题。json和一个空文件。ts文件到项目根目录。tsconfig。json:包含
{
"compilerOptions": {
"allowJs": false,
"noEmit": true // Do not compile the JS (or TS) files in this project on build
},
"compileOnSave": false,
"exclude": [ "src", "wwwroot" ],
"include": [ "file.ts" ]
}
#3
3
When using Visual Studio Code, building the project (i.e. pressing Ctrl + Shift + B), moves your .ts file into the .vscode folder (I don't know why it does this), then generates the TS18003 error. What I did was move my .ts file out of the .vscode folder, back into the root folder and build the project again.
使用Visual Studio代码时,构建项目(即按Ctrl + Shift + B),将.ts文件移动到.vscode文件夹中(我不知道为什么会这样),然后生成TS18003错误。我所做的就是将我的.ts文件从.vscode文件夹中移回根文件夹,并再次构建项目。
The project built successfully!
项目成功了!
#4
2
I am getting this error, "No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["/"]' and 'exclude' paths were '["/.spec.ts","app_//.ts","/.d.ts","node_modules"]'."
我得到了这个错误,“在配置文件‘tsconfig.json’中没有发现输入。指定”包括“路径”(“/”)和“排除”路径是“(“/ .spec.ts”、“app_ / / .ts”、“/ .d.ts”、“node_modules”)的。”
I have a .tsconfig file, which reads ts files from "./src" folder.
我有一个.tsconfig文件,它从“”中读取ts文件。/ src文件夹。
The issue here is with that source folder not containing .ts files and i am running tslint. I resolved issue by removing tslint task from my gulp file. As i don't have any .ts files to be compiled and linted. My issue is resolved by doing this.
这里的问题是源文件夹不包含.ts文件,我正在运行tslint。我通过从gulp文件中删除tslint任务来解决这个问题。因为我没有任何.ts文件需要编译和连接。通过这样做,我的问题得到了解决。
#5
2
add .ts file location in 'include' tag then compile work fine. ex.
在“include”标签中添加.ts文件位置,然后编译工作。前女友。
"include": [
"wwwroot/**/*" ]
#6
1
I had existing tsconfig files for 4 existing projects in my solution. After upgrading to vs2017 I experienced this problem. It was fixed by adding the (supposedly default) include and exclude sections to the files, as described by NicoJuicy.
我的解决方案中有4个现有项目的tsconfig文件。升级到vs2017后,我遇到了这个问题。它是通过添加(应该是默认的)包含和排除部分到文件来修复的,如NicoJuicy所描述的。
#7
0
Btw, just had the same problem.
顺便说一下,也有同样的问题。
If you had my case, then you probably have the tsconfig.json not in the same directory as the .ts file.
如果你有我的箱子,那么你可能有tsconfig。json不在.ts文件所在的目录中。
(In my case I stupidly had next to launch.json and tasks.json inside the .vscode folder :P)
(在我的情况下,我愚蠢地选择了下一次发射。json和任务。.vscode文件夹中的json:P)
#8
0
I added the following in the root ( visual studio )
我在根(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
}
}