tag:help.appveyor.com,2012-11-13:/discussions/problems/26157-errorineffective-mark-compacts-near-heap-limit-allocation-failed-javascript-heap-out-of-memoryAppVeyor: Discussion 2020-02-05T06:35:05Ztag:help.appveyor.com,2012-11-13:Comment/480641262020-02-05T04:22:13Z2020-02-05T04:22:13ZErrorIneffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory<div><p>Hi Aristotle,</p>
<p>What Node.js version do you use in your builds?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/480641262020-02-05T04:24:30Z2020-02-05T04:24:30ZErrorIneffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory<div><p>This happens for both version 8 and 10.</p></div>Aristotle Utag:help.appveyor.com,2012-11-13:Comment/480641262020-02-05T04:32:28Z2020-02-05T04:32:28ZErrorIneffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory<div><p>OK, starting from Node.js 8.x you can define a global environment variable increasing JS heap size: <a href="https://github.com/npm/npm/issues/12238#issuecomment-367147962">https://github.com/npm/npm/issues/12238#issuecomment-367147962</a></p>
<p>You can add that variable on either "Environment" tab of AppVeyor project settings or in <code>appveyor.yml</code>.</p>
<p>Let me know if that worked.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/480641262020-02-05T04:59:52Z2020-02-05T06:16:51ZErrorIneffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory<div><p>Thank you, below is the configuration that solved my issue. Setting it to <code>4096</code> still fails, so i tried setting it to <code>3072</code>. Works now!</p>
<pre>
<code>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</code>
</pre></div>Aristotle Utag:help.appveyor.com,2012-11-13:Comment/480641262020-02-05T05:34:47Z2020-02-05T05:34:47ZErrorIneffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory<div><p>Thanks for the update and sharing the solution!</p></div>Feodor Fitsner