title: Azure Devops pipeline build suddenly stopped working
body: <p>Our Azure build pipeline started failing today. This was working fine with the same code a few days back. I'm struggling to find a reason. The build works fine in my local machine but doesn’t work on DevOps.</p>
  <p>Below are some lines from the error log. Can anyone guide me to find the issue please?</p>
  <p>Start of the error in the logs:</p>
  <pre><code>2021-12-04T09:08:08.1234486Z 6728 timing metavuln:packument:sass-loader Completed in 28ms
  2021-12-04T09:08:08.1234976Z 6729 timing metavuln:load:security-advisory:sass-loader:sKa4m2v9CoUt2NE/HFdn2iHPGTVRUKpbo4oLNnOVBTLyHGQ/KmGqhFuwUlvkR/owQNQEXwZFOGQt5TNCCkoHWw== Completed in 5ms
  2021-12-04T09:08:08.1235699Z 6730 timing metavuln:cache:put:security-advisory:sass-loader:0+Q0+uaac9NG7L1nbkGVbvFbaBvbLzENFqRpXWUE7U0t2jjSSjVZ79o6UtQRkcjQ/gcgS0kd8p2vAnNjva/3Eg== Completed in 15ms
  2021-12-04T09:08:08.1236341Z 6731 timing metavuln:calculate:security-advisory:sass-loader:sKa4m2v9CoUt2NE/HFdn2iHPGTVRUKpbo4oLNnOVBTLyHGQ/KmGqhFuwUlvkR/owQNQEXwZFOGQt5TNCCkoHWw== Completed in 48ms
  2021-12-04T09:08:08.1237034Z 6732 timing metavuln:cache:get:security-advisory:imagemin-jpegtran:s0MaKyyWWIoVMQAlu89TduB0lW+w9ANmAjDodgTT4fcy4ki3FsHrWalCv/COtdz4o3adGXtGYSamW2jub7ta+Q== Completed in 1ms
  2021-12-04T09:08:08.1237558Z 6733 info run node-sass@4.14.1 postinstall { code: 1, signal: null }
  2021-12-04T09:08:08.1238006Z 6734 http fetch GET 200 https://registry.npmjs.org/imagemin-jpegtran 5491ms (cache miss)
  2021-12-04T09:08:08.1238399Z 6735 timing metavuln:packument:imagemin-jpegtran Completed in 5491ms
  2021-12-04T09:08:08.1238952Z 6736 timing metavuln:load:security-advisory:imagemin-jpegtran:u6oOqPrIyXrFjQnhqewixjKDTSD2uoKmmWFnU4zRuXrk8rdHkm8zODnNe7xy3697n8Yy/cBLgdQBE6mFa/kxsg== Completed in 1ms
  2021-12-04T09:08:08.1239443Z 6737 timing reify:rollback:createSparse Completed in 5296ms
  2021-12-04T09:08:08.1239823Z 6738 timing reify:rollback:retireShallow Completed in 0ms
  2021-12-04T09:08:08.1240144Z 6739 timing command:install Completed in 77131ms
  2021-12-04T09:08:08.1240444Z 6740 verbose stack Error: command failed
  2021-12-04T09:08:08.1240974Z 6740 verbose stack     at ChildProcess.&lt;anonymous&gt; (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
  2021-12-04T09:08:08.1241517Z 6740 verbose stack     at ChildProcess.emit (node:events:390:28)
  2021-12-04T09:08:08.1241956Z 6740 verbose stack     at maybeClose (node:internal/child_process:1064:16)
  2021-12-04T09:08:08.1242405Z 6740 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
  2021-12-04T09:08:08.1242817Z 6741 verbose pkgid node-sass@4.14.1
  2021-12-04T09:08:08.1243073Z 6742 verbose cwd D:\a\1\s
  2021-12-04T09:08:08.1243323Z 6743 verbose Windows_NT 10.0.17763
  2021-12-04T09:08:08.1243767Z 6744 verbose argv &quot;C:\\Program Files\\nodejs\\node.exe&quot; &quot;C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js&quot; &quot;install&quot;
  2021-12-04T09:08:08.1244152Z 6745 verbose node v16.13.0
  2021-12-04T09:08:08.1244424Z 6746 verbose npm  v8.1.0
  2021-12-04T09:08:08.1244643Z 6747 error code 1
  2021-12-04T09:08:08.1244930Z 6748 error path D:\a\1\s\node_modules\gulp-sass\node_modules\node-sass
  2021-12-04T09:08:08.1245270Z 6749 error command failed
  2021-12-04T09:08:08.1245577Z 6750 error command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
  2021-12-04T09:08:08.1246161Z 6751 error Building: C:\Program Files\nodejs\node.exe D:\a\1\s\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
  2021-12-04T09:08:08.1246648Z 6752 error gyp info it worked if it ends with ok
  </code></pre>
  <p>Last few lines of the log:</p>
  <pre><code>2021-12-04T09:08:08.1681219Z 6752 error gyp verb node dev dir C:\Users\VssAdministrator\.node-gyp\16.13.0
  2021-12-04T09:08:08.1681621Z 6752 error gyp verb found first Solution file build/binding.sln
  2021-12-04T09:08:08.1682050Z 6752 error gyp verb using MSBuild: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
  2021-12-04T09:08:08.1682559Z 6752 error gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
  2021-12-04T09:08:08.1682993Z 6752 error gyp info spawn args [
  2021-12-04T09:08:08.1683269Z 6752 error gyp info spawn args   'build/binding.sln',
  2021-12-04T09:08:08.1683573Z 6752 error gyp info spawn args   '/nologo',
  2021-12-04T09:08:08.1683893Z 6752 error gyp info spawn args   '/p:Configuration=Release;Platform=x64'
  2021-12-04T09:08:08.1684205Z 6752 error gyp info spawn args ]
  2021-12-04T09:08:08.1684463Z 6752 error gyp ERR! UNCAUGHT EXCEPTION
  2021-12-04T09:08:08.1684876Z 6752 error gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\Bin\MSBuild.exe ENOENT
  2021-12-04T09:08:08.1685424Z 6752 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
  2021-12-04T09:08:08.1685894Z 6752 error gyp ERR! stack     at onErrorNT (node:internal/child_process:477:16)
  2021-12-04T09:08:08.1686366Z 6752 error gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
  2021-12-04T09:08:08.1686766Z 6752 error gyp ERR! System Windows_NT 10.0.17763
  2021-12-04T09:08:08.1687321Z 6752 error gyp ERR! command &quot;C:\\Program Files\\nodejs\\node.exe&quot; &quot;D:\\a\\1\\s\\node_modules\\node-gyp\\bin\\node-gyp.js&quot; &quot;rebuild&quot; &quot;--verbose&quot; &quot;--libsass_ext=&quot; &quot;--libsass_cflags=&quot; &quot;--libsass_ldflags=&quot; &quot;--libsass_library=&quot;
  2021-12-04T09:08:08.1687915Z 6752 error gyp ERR! cwd D:\a\1\s\node_modules\gulp-sass\node_modules\node-sass
  2021-12-04T09:08:08.1688248Z 6752 error gyp ERR! node -v v16.13.0
  2021-12-04T09:08:08.1688513Z 6752 error gyp ERR! node-gyp -v v3.8.0
  2021-12-04T09:08:08.1688788Z 6752 error gyp ERR! This is a bug in `node-gyp`.
  2021-12-04T09:08:08.1689164Z 6752 error gyp ERR! Try to update node-gyp and file an Issue if it does not help:
  2021-12-04T09:08:08.1689568Z 6752 error gyp ERR!     &lt;https://github.com/nodejs/node-gyp/issues&gt;
  2021-12-04T09:08:08.1689916Z 6752 error Build failed with error code: 7
  2021-12-04T09:08:08.1690179Z 6753 verbose exit 1
  2021-12-04T09:08:08.1690283Z 
  2021-12-04T09:08:08.1720104Z ##[error]Error: Npm failed with return code: 1
  2021-12-04T09:08:08.1747833Z ##[section]Finishing: Npm
  </code></pre>
  <p>Below is the yaml file</p>
  <pre><code>name: 1.0.$(BuildID)-$(SourceBranchName)
  trigger:
  - release
  
  variables:
    versionNumber: '1.0.$(BuildID)'
    mvcSolution: 'SVHA.MVC.Web.sln'
    
  jobs:
    - job: &quot;BuildStaging&quot;
      variables:
        buildConfiguration: 'Staging'
        buildPlatform: 'Any CPU'
      pool:
        vmImage: 'windows-latest'
      steps:
      
      - task: Npm@1
        inputs:
          command: 'install'
          workingDir: './'
  
      - task: CmdLine@2
        inputs:
          script: 'npm run apps-build'
          workingDirectory: './'
  
      - task: Gulp@1
        inputs:
          gulpFile: 'gulpfile.js'
          targets: 'build'
          arguments: '--production'
          enableCodeCoverage: false
      
      - task: NuGetToolInstaller@1
      
          
      - task: NuGetCommand@2
        inputs:
          restoreSolution: '$(mvcSolution)'    
   
      - task: VSBuild@1
        inputs:
          solution: '$(mvcSolution)'
          msbuildArgs: '/t:Rebuild /p:Configuration=Staging;DeployOnBuild=true;DeployTarget=Package;AutoParameterizationWebConfigConnectionStrings=False;_PackageTempDir=&quot;$(Build.BinariesDirectory)\mvc&quot;'
          platform: '$(buildPlatform)'
          configuration: '$(buildConfiguration)'
  
      - task: CopyFiles@2
        inputs:
          SourceFolder: 'src\SVHA.Web\Config\staging'
          Contents: 'connectionStrings.config'
          TargetFolder: '$(Build.BinariesDirectory)\mvc\Config'
          OverWrite: true
      
       
      - task: ArchiveFiles@2
        inputs:
          rootFolderOrFile: '$(Build.BinariesDirectory)\mvc'
          includeRootFolder: false
          archiveType: 'zip'
          archiveFile: '$(Build.ArtifactStagingDirectory)\mvc.zip'
          replaceExistingArchive: true
      
      - task: PublishBuildArtifacts@1
        inputs:
          PathtoPublish: '$(Build.ArtifactStagingDirectory)'
          ArtifactName: 'staging'
          publishLocation: 'Container'
  </code></pre>