当我在.Net Core VS2019中构建新项目时,构建因错误而失败。该项目中有一些使用打字稿的css和js文件会导致此错误。但是我不知道出了什么问题或可能是什么原因。
我尝试安装和卸载最新版本的打字稿,还安装了node.JS
构建时得到的详细输出是:
Task "VsTsc"
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe "C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js" --project "D:\Piccolo.Admin\Piccolo.Admin\wwwroot\assets\vendors\general\summernote\tsconfig.json" --listEmittedFiles --locale en-US
1> Unknown output: throw e;
1> Unknown output: ^
1> Unknown output: at Object.createNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:16472:20)
1> Unknown output: at createSynthesizedNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:60303:23)
1> Unknown output: at Object.createTypeQueryNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:60891:20)
1> Unknown output: at symbolToTypeNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34983:31)
1> Unknown output: at createAnonymousTypeNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34315:36)
1> Unknown output: at typeToTypeNodeHelper (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34251:28)
1> Unknown output: at C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34042:106
1> Unknown output: at withContext (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34083:37)
1> Unknown output: at Object.typeToTypeNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34042:28)
1> Unknown output: at typeToString (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34021:40)
1> C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\build\Microsoft.TypeScript.targets(462,5): error MSB6006: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe" exited with code 1.
1> Done executing task "VsTsc" -- FAILED.
答案 0 :(得分:0)
我要发布项目时遇到相同的错误
C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.7\build\Microsoft.TypeScript.targets(463,5): error MSB6006: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe" exited with code 1.
我在“工具”->“选项”->“项目和解决方案”->“构建并运行”中将“ MSBuild项目的构建输出详细程度”设置为“详细”,我发现VS希望编译多个.ts文件,但不能这样做
这是我的.ts文件无法编译
4>Target "CompileTypeScript" skipped, due to false condition; ('$(BuildingProject)' != 'false' AND '@(ConfigFiles)' == '' AND '@(TypeScriptCompile)' != '' AND '$(DesignTimeBuild)' != 'true') was evaluated as ('true' != 'false' AND 'App_Themes\Dashboard\Vendors\summernote\tsconfig.json' == '' AND 'App_Themes\Dashboard\Vendors\handlebars\lib\handlebars.d.ts;App_Themes\Dashboard\Vendors\moment\moment.d.ts;App_Themes\Dashboard\Vendors\perfect-scrollbar\types\perfect-scrollbar.d.ts;App_Themes\Dashboard\Vendors\popper.js\index.d.ts;App_Themes\Dashboard\Vendors\sweetalert2\sweetalert2.d.ts;App_Themes\Dashboard\Vendors\tooltip.js\index.d.ts;Scripts\index.d.ts' != '' AND '' != 'true').
我排除了这些文件并成功发布了我的项目
您可以从项目中排除.ts文件,也可以修改并重试
答案 1 :(得分:0)