ErrorIneffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Aristotle U's Avatar

Aristotle U

05 Feb, 2020 04:15 AM

I seem not to get a successful build.

The error occurs, when building client scripts.

I have the node error logs below.

Binary found at C:\projects\project_name\src\ClientApp\node_modules\node-sass\vendor\win32-ia32-64\binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: canvas@1.6.12 (node_modules\canvas):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: canvas@1.6.12 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
added 1542 packages from 1791 contributors and audited 11103 packages in 67.761s
found 75 vulnerabilities (17 low, 22 moderate, 34 high, 2 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
> machaik@1.0.6 build C:\projects\mac-haik-crm\src\ClientApp
> node build/build.js
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 00E8D1FE node::MakeCallback+3982
 2: 012B90E2 v8::internal::Heap::MaxHeapGrowingFactor+8194
 3: 012B02C1 v8::internal::ScavengeJob::operator=+14993
 4: 012B7A1E v8::internal::Heap::MaxHeapGrowingFactor+2366
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! machaik@1.0.6 build: `node build/build.js`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the machaik@1.0.6 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\appveyor\AppData\Roaming\npm-cache\_logs\2020-02-04T13_41_54_665Z-debug.log
An error occurred when executing task 'ClientAppBuild'.
Error: One or more errors occurred.
Npm: Process returned an error (exit code 134).
Command exited with code 1

  1. Support Staff 1 Posted by Feodor Fitsner on 05 Feb, 2020 04:22 AM

    Feodor Fitsner's Avatar

    Hi Aristotle,

    What Node.js version do you use in your builds?

  2. 2 Posted by Aristotle U on 05 Feb, 2020 04:24 AM

    Aristotle U's Avatar

    This happens for both version 8 and 10.

  3. Support Staff 3 Posted by Feodor Fitsner on 05 Feb, 2020 04:32 AM

    Feodor Fitsner's Avatar

    OK, starting from Node.js 8.x you can define a global environment variable increasing JS heap size: https://github.com/npm/npm/issues/12238#issuecomment-367147962

    You can add that variable on either "Environment" tab of AppVeyor project settings or in appveyor.yml.

    Let me know if that worked.

  4. 4 Posted by Aristotle U on 05 Feb, 2020 04:59 AM

    Aristotle U's Avatar

    Thank you, below is the configuration that solved my issue. Setting it to 4096 still fails, so i tried setting it to 3072. Works now!

    environment:
      nodejs_version: "10"
    
    init:
      - cmd: set NODE_OPTIONS=--max-old-space-size=3072
    
    install:
      - ps: Install-Product node $env:nodejs_version
    
    version: 1.0.{build}
    image: Visual Studio 2019
    build_script:
    - cmd: PowerShell -Version 2.0 .\build.ps1
    test: off
    
  5. Support Staff 5 Posted by Feodor Fitsner on 05 Feb, 2020 05:34 AM

    Feodor Fitsner's Avatar

    Thanks for the update and sharing the solution!

  6. Aristotle U closed this discussion on 05 Feb, 2020 06:35 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac