0

I am working on CI pipeline in my project. My project consists of Angular 14 and ASP.NET Core 6.0 Web API. Currently when I run my pipeline for the below step, I get an error

Error: javascript OOM in GC during deserialization
##[error]Cmd.exe exited with code '-2147483645'.

Can I please know what this error message means, and why I am getting it? I also tried to increase the size value of the parameter till node --max_old_space_size=64384 but I still get that error message:

FATAL ERROR: NewSpace::Rebalance Allocation failed - JavaScript heap out of memory
##[error]Cmd.exe exited with code '134'.

Below is my yaml file till that step:

trigger: none

variables:
- name: solution
  value: 'MyApp.sln'
- name: buildPlatform
  value: 'Any CPU'
- name: buildConfiguration
  value: 'Release'
- name: "npm_config_cache"
  value: $(Pipeline.Workspace)/.npm

stages:
- stage: StartAzVMAgent
  jobs:
  - job: MsHostedAgentJobStartAzVM
    timeoutInMinutes: 0
    pool:
      vmImage: 'windows-latest'
    steps:
    - task: AzureCLI@2
      displayName: Azure CLI
      inputs:
        azureSubscription: "Az-DevOps-AgentManager"
        scriptType: ps
        scriptLocation: inlineScript
        inlineScript: |
          az --version
          az account show
          az vm start --name  MyDeployment-Agent --no-wait --resource-group MyDeployment

- stage: __default
  jobs:
  - job: Job
    timeoutInMinutes: 0
    pool:
      name: Default
      demands:
      - Use_for -equals klcloud
    steps:
     - task: Npm@1
       displayName: Install Node dependencies (packages)
       inputs:
         command: custom
         customCommand: install --save --legacy-peer-deps 
         workingDir: 'MyApp.WebUI\MyClientApp'
        
     - task: Npm@1
       displayName: Install Node dependencies (packages)
       inputs:
         command: custom
         customCommand: install sweetalert2 file-saver --legacy-peer-deps
         workingDir: 'MyApp.WebUI\MyClientApp'

    - task: CmdLine@2
      displayName: Building Client App
      inputs:
        script: node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build  --configuration production --aot --build-optimizer=true --common-chunk=true  --named-chunks=false --optimization=true --vendor-chunk=true --progress=true
        workingDirectory: 'MyApp.WebUI\MyClientApp'
        

My version details are as follows:

{ npm: '8.19.2', node: '16.17.1', v8: '9.4.146.26-node.22', uv: '1.43.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.18.1', modules: '93', nghttp2: '1.47.0', napi: '8', llhttp: '6.0.9', openssl: '1.1.1q+quic', cldr: '41.0', icu: '71.1', tz: '2022a', unicode: '14.0', ngtcp2: '0.1.0-DEV', nghttp3: '0.1.0-DEV' }

Thank you

Rahul Parab
  • 59
  • 10

1 Answers1

3

Finally after almost 1 week I resolved this issue by installing right version of Node.js in my build agent. No need of increasing memory (RAM) in our build agent.

Problem: I had installed node-v16.17.0-x86 which is not for 64-bit processing machine.

Solution: I then installed the right version as per my build agent configuration i.e. node-v16.17.1-x64 which is suitable for 64-bit machine.

Thank You

Rahul Parab
  • 59
  • 10