After you set your environment variable NODE_OPTIONS = --max-old-space-size=8192
, how do you confirm that it is now taking effect? Is there a npm command to print the current value? Of course if I just print the environment variable with echo %NODE_OPTIONS%
, I get the value but that would be different if npm/node itself prints and acknowledges that it is the current value taking effect.
Asked
Active
Viewed 266 times
0

Alex Pappas
- 2,377
- 3
- 24
- 48
1 Answers
0
NODE_OPTIONS='--max-old-space-size=10240' node -e 'console.log(`node heap limit = ${require("v8").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'
will print out:
node heap limit = 10288 Mb
Credit: @jayseeare and @sam-watkins here

Myer
- 3,670
- 2
- 39
- 51