Arquivo

Archive for the ‘ASP.NET CORE’ Category

Build > Asp Net Core, Node, VSTS > unexpected end of file

Olá!

Ao criar uma build definition com Visual Studio Team Services (VSTS), ocorreu uma falha na etapa de publish, e venho aqui compartilhar a solução encontrada.

Setup:

  • Projeto ASP NET CORE
  • Agent Queuee: Hosted VS2017
  • JavaScriptServices (https://github.com/aspnet/JavaScriptServices/)
    • Server-side prerendering for universal (a.k.a. isomorphic) applications, where your Angular / React / etc. components are first rendered on the server, and then transferred to the client where execution continues
    • Webpack middleware so that, during development, any webpack-built resources will be generated on demand, without you having to run webpack manually or compile files to disk
    • Hot module replacement so that, during development, your code and markup changes will be pushed to your browser and updated in the running application automatically, without even needing to reload the page
    • Routing helpers for integrating server-side routing with client-side routing

Criei uma build definition para a camada de apresentação, com as seguintes etapas:

BuildDefinitionVstsEtapas

Ao executar o processo de build recebi o seguinte erro no processo de [ publish ]:


2017-09-25T15:51:15.6205662Z ##[section]Starting: Publish
2017-09-25T15:51:15.6205662Z ==============================================================================
2017-09-25T15:51:15.6205662Z Task : .NET Core
2017-09-25T15:51:15.6205662Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet.
2017-09-25T15:51:15.6205662Z Version : 2.1.3
2017-09-25T15:51:15.6205662Z Author : Microsoft Corporation
2017-09-25T15:51:15.6205662Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2017-09-25T15:51:15.6205662Z ==============================================================================
2017-09-25T15:51:16.3385534Z [command]"C:\Program Files\dotnet\dotnet.exe" publish d:\a\1\s\Tcs.Erp.UI.Web\Tcs.Erp.UI.Web.csproj --configuration release --output d:\a\1\a\Tcs.Erp.UI.Web
2017-09-25T15:51:17.8425717Z Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
2017-09-25T15:51:17.8425717Z Copyright (C) Microsoft Corporation. All rights reserved.
2017-09-25T15:51:17.8425717Z
2017-09-25T15:51:20.2386553Z Tcs.Erp.UI.Web -> d:\a\1\s\Tcs.Erp.UI.Web\bin\release\netcoreapp2.0\Tcs.Erp.UI.Web.dll
2017-09-25T15:51:45.6297302Z EXEC : npm ERR! tar.unpack unzip error d: \a\_temp\npm-3668-ce5239c6\registry.npmjs.org\typescript\-\typescript-2.4.1.tgz [d:\a\1\s\Tcs.Erp.UI.Web\Tcs.Erp.UI.Web.csproj]
2017-09-25T15:51:52.7841764Z npm ERR! Windows_NT 10.0.14393
2017-09-25T15:51:52.7841764Z npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
2017-09-25T15:51:52.7851759Z npm ERR! node v6.10.0
2017-09-25T15:51:52.7851759Z npm ERR! npm v3.10.10
2017-09-25T15:51:52.7851759Z npm ERR! code Z_BUF_ERROR
2017-09-25T15:51:52.7851759Z npm ERR! errno -5
2017-09-25T15:51:52.7851759Z
2017-09-25T15:51:52.7851759Z npm ERR! unexpected end of file
2017-09-25T15:51:52.7851759Z npm ERR!
2017-09-25T15:51:52.7851759Z EXEC : npm ERR! If you need help, you may report this error at: [d:\a\1\s\Tcs.Erp.UI.Web\Tcs.Erp.UI.Web.csproj]
2017-09-25T15:51:52.7851759Z npm ERR! <https://github.com/npm/npm/issues&gt;
2017-09-25T15:51:52.8351980Z
2017-09-25T15:51:52.8361795Z npm ERR! Please include the following file with any support request:
2017-09-25T15:51:52.8361795Z npm ERR! d:\a\1\s\Tcs.Erp.UI.Web\npm-debug.log
2017-09-25T15:51:52.8821822Z d:\a\1\s\Tcs.Erp.UI.Web\Tcs.Erp.UI.Web.csproj(36,5): error MSB3073: The command "npm install" exited with code -5.
2017-09-25T15:51:52.9151842Z ##[error]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1
2017-09-25T15:51:52.9171845Z ##[error]Dotnet command failed with non-zero exit code on the following projects : d:\a\1\s\Tcs.Erp.UI.Web\Tcs.Erp.UI.Web.csproj
2017-09-25T15:51:52.9241833Z ##[section]Finishing: Publish

Ao procurar pelo erro no nosso amigo google, encontrei essa Issue no GitHub do npm:

https://github.com/npm/npm/issues/14394
Com a seguinte resposta:

Pasted_Image_25_09_17_13_34Então editei minha build definition, e inclui a seguinte tarefa antes do processo de [ publish ]

Pasted_Image_25_09_17_13_36

E voilà:

Pasted_Image_25_09_17_13_37Agora é só criar a [ release definition ].

🙂

Anúncios
dotnettips.wordpress.com/

Helping Programmers Since 1994

Viagem e Voo

Dicas para viagens, férias e voos nacionais e internacionais

Ivan Guimarães Meirelles

Analista Desenvolvedor

Void Podcast

Vazio e sem retorno de valor

Elemar DEV

Negócios, tecnologia e desenvolvimento

2,000 Things You Should Know About WPF

Everything a WPF Developer Needs to Know, in Bite-Sized Chunks

blog

so long

Fernando Franzini Blog

Engenharia de Software e Arquitetura Ágil

Gabriel RB.net

Blog técnico, com dicas, códigos, novidades e problemas do dia-a-dia programando.

Alexandre Valente's Blog

Experiências em tecnologia e assuntos diversos

%d blogueiros gostam disto: