3
votes

I'm trying to deploy my ASP.NET 5 Beta 7 web application to Azure platform using Continuous Deployment on Visual Studio Online.

I've already follow these guides:

When I commit and push a changes, the build task triggers correctly but it fails when executing prepublish script of project.json:

"scripts": {
   "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
}

The error (warning) is:

npm WARN optional dep failed, continuing fsevents@1.0.0

I was able to deploy by enabling Continue on error option in the build definition and only for PublishLocal.ps1 step (that fails).

Visual Studio Online completes (partially) the build and deploy my site to Azure and everything seems to works without problems, but, what is that error? There is a way to fix it?

Here is my PublishLocal.ps1 step (from http://www.brandonmartinez.com/2015/09/16/deploying-asp-net-5-beta-7-through-vso/):

#Requires -Version 3.0

param($vsoProjectName, $projectName, $buildConfiguration, $buildSourcesDirectory)

$VerbosePreference = "continue"

&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}

$globalJson = Get-Content -Path $PSScriptRoot\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore

if($globalJson)
{
    $dnxVersion = $globalJson.sdk.version
}
else
{
    Write-Warning "Unable to locate global.json to determine using 'latest'"
$dnxVersion = "latest"
}

& $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -Persistent

$dnxRuntimePath = "$($env:USERPROFILE)\.dnx\runtimes\dnx-clr-win-x86.$dnxVersion"

& dnu build "$PSScriptRoot\src\$projectName" --configuration "$buildConfiguration"

& dnu publish "$PSScriptRoot\src\$projectName" --configuration "$buildConfiguration" --out "$buildSourcesDirectory\$vsoProjectName\artifacts\bin\$buildConfiguration\Publish" --runtime "$dnxRuntimePath"
1
Can you post here the complete error message you got?Vicky - MSFT
The only error message is: npm WARN optional dep failed, continuing fsevents@1.0.0Androidian

1 Answers

0
votes

Without seeing your entire build log, it's a little difficult to diagnose. However, my assumption is that NPM is writing WARN messages to stderr. As such, the VSTS build server will see that as an error instead of a warning.

I would recommend either adding --quiet to your NPM scripts, or update your dependency to not throw the WARN. You could also changed the PowerShell script VerbosePreference to SilentlyContinue to see if that stops printing the message as well.