Disable Npm warnings as errors: build tfs definition

I get npm warnings as errors during build using build definition. enter image description here

Then I added the following property to the MSBuild Arguments in the Build Definition :

/p:TreatWarningsAsErrors=False

but it doesn’t work yet.

I also cross-checked by right-clicking on each project, and none of them has the option "Handle warnings as errors."

I call the npm install command from a post-build script.

I also restarted the build controller and created the agent after the changes I tried but did not succeed.

Any help in this direction is appreciated.

+4
source share
3

MSBuild ... post-build script MSBuild.

, npm stderr, TFS . , stdout :

npm install 2>&1

, , . npm install PowerShell script script. , , ERR! :

& npm install *>&1 | ForEach-Object {
    $obj = $_
    if ( $obj -is [System.Management.Automation.ErrorRecord] ) {
        $s = $obj.Exception.Message
    }
    else {
        $s = $obj.ToString()
    }
    if ( $s.Contains('ERR!') ) {
        Write-Error $s
    }
    else {
        Write-Output $s
    }
}
$LASTEXITCODE = 0

, $LASTEXITCODE , PowerShell npm TFS.

+6

/p:TreatWarningsAsErrors="false"
0

You can disable npm during the installation process with the argument --silent:

npm install --silent

You do not need the msbuild argument this way.

0
source

Source: https://habr.com/ru/post/1625272/


All Articles