Rebuild fails with exit 1: ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL

Have you got the two kernel tunables set? They will affect how much virtual memory is needed.