Installing dependencies on Cloudflare Pages builds failed

Hey! I tried to migrate my websites infrastructure into Cloudflare Pages, but it failed on yarn install phase with this message:

17:28:03.731	Installing project dependencies: yarn
17:28:04.620	➤ YN0000: · Yarn 4.2.2
17:28:04.628	➤ YN0000: ┌ Resolution step
17:28:04.904	➤ YN0000: └ Completed in 0s 275ms
17:28:04.905	➤ YN0000: ┌ Post-resolution validation
...
17:28:04.973	➤ YN0000: └ Completed
17:28:04.974	➤ YN0000: ┌ Fetch step
17:31:55.777	Failed: build exceeded memory limit and was terminated

The deployment id is 697485e9-c735-4295-8090-8228de48f6a4. And the site would be used with an enterprise domain if it can be deployed.