To resolve this issue, you can increase the memory limit allocated to Node.js during the build process by setting the
NODE_OPTIONS environment variable. Here’s how you can do it:
This sets the maximum heap size to 4GB (4096MB). 3. Run the build command again:
npm run build
This time, the build process should complete without the out of memory error.
If you need to allocate more memory, you can increase the
max-old-space-size value accordingly. However, keep in mind that allocating too much memory can also cause performance issues.