Random "build exceeded the time limit and was terminated" during `npm install`

For Workes & Pages, what is the name of the domain?

moneymarket.fun

What is the error message?

Failed: build exceeded the time limit and was terminated. Refer to Limits | Cloudflare Pages docs for build limits

What is the issue or error you’re encountering

Cloudflare Page build times out and does not successfully complete as a result

What steps have you taken to resolve the issue?

Retried the deployment a few times
Updated NODE_VERSION to 20.17.0
Updated some (not all) npm packages

What are the steps to reproduce the issue?

Retry a deployment. Successful deployments complete in less than 15 minutes. If it goes longer, it will likely time out. Intermittent failures appears to have started around mid-July 2024 with it occurring progressively more frequently until now.

Happens on two different sites with two different code bases, both running requiring node and Python (for preprocessing data) and built using “next export”