JavaScript heap out of memory
有时候执行 node 命令的时候会内存溢出,这时候可以手动设置最大内存大小。
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
解决办法
Linux/macOS
export NODE_OPTIONS=--max-old-space-size=8192
Windows
$env:NODE_OPTIONS="--max-old-space-size=8192"