Skip to content

Instantly share code, notes, and snippets.

@arturkula
Last active June 6, 2019 05:17
Show Gist options
  • Save arturkula/1fe89396381a1a41ffb5e096027713c5 to your computer and use it in GitHub Desktop.
Save arturkula/1fe89396381a1a41ffb5e096027713c5 to your computer and use it in GitHub Desktop.
set NODE_OPTIONS env variable - increases memory for node
[Environment]::SetEnvironmentVariable("NODE_OPTIONS", "--max-old-space-size=8192", "User")
@arturkula
Copy link
Author

When you experience this error:

npm : FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

try to set env variable: NODE_OPTIONS=--max-old-space-size=8192

source:
angular/angular-cli#13734
https://serverfault.com/a/349587

@arturkula
Copy link
Author

arturkula commented Jun 6, 2019

Don't set this as a global user env variable, it will fail Visual Studio 2019 installer to run. Also Postman don't like this variable to be set - it won't run....

Try to check if you have NODE_OPTIONS variable defined. We have same issue and after remove this variable, VS works well again.

Source: https://developercommunity.visualstudio.com/solutions/227820/view.html

Set this env var like this for TeamCity: https://stackoverflow.com/questions/36198286/how-to-update-or-add-an-environment-variable-to-a-teamcity-agent/36198287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment