stage('Build') { steps { powershell ''' Write-Output "Starting Yarn Install" try { \$ErrorActionPreference = 'Stop' yarn install } catch { Write-Output "Install failed : \$PSItem" } ''' } }
However, when I run the command on the server itself in the directory, all i get is > yarn install v1.5.1 > > yarn : warning package.json: No license field > > At line:1 char:19 > > + try { yarn install --frozen-lockfile } catch { ... > > + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > + CategoryInfo : NotSpecified: (warning package.json: No >> license field:String) [], RemoteException > > + FullyQualifiedErrorId : NativeCommandError > > >> warning soe@0.0.0: No license field > > [1/4] Resolving packages... > > success Already up-to-date. > > Done in 2.16s. > > [blwdsoabuild4]: PS C:\Jenkins\workspace\SOE.POC> echo $LASTEXITCODE > > 0 > > Seems to me that the powershell method is incorrectly interpreting the warning as a remote exception... The catch never gets hit, and even if I set the $global:LASTEXITCODE to zero after the yarn install line it still fails. Any hints as to what else to try or consider would be greatly appreciated. Yarn Version is 1.5.2 and Node is LTS (8.9.4) with Powershell version 5.1. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3fba7e28-db0b-43a5-932e-531a4dc7b3aa%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.