The official taro document build setting NODE_OPTIONS=--max-old-space-size=5120 in packages.json, but I would link to deploy a TARO documents to my 4 GB memory server, so here is how to.
Change NODE_OPTIONS settings
Change to NODE_OPTIONS=--max-old-space-size=2500 is reasonable in a 4GB memory server, but that’s far from enough.
Enable the swap
sudofallocate-l1G/swapfile
# or sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576