ECONNRESET npm error when building on Pages

Hello, we've been running into an intermittent ECONNRESET error during the npm install step when building our app on Pages. This never used to happen but it started happening daily over the last few weeks. We're using Node v18.20.0 (npm v10.5.0). Have you seen this type of intermitent issue before? I'd appreciate any suggestions for how to fix it. Thank you! Happy to send an example build, but here's the relevant portion of the build log:
08:19:53.000 Started restoring cached node modules
08:19:53.009 Finished restoring cached node modules
08:19:53.335 Installing NPM modules using NPM version 10.5.0
08:22:28.921 npm ERR! code ECONNRESET
08:22:28.921 npm ERR! errno ECONNRESET
08:22:28.923 npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/bn.js: aborted
08:22:28.924 npm ERR! network This is a problem related to network connectivity.
08:22:28.924 npm ERR! network In most cases you are behind a proxy or have bad network settings.
08:22:28.924 npm ERR! network
08:22:28.925 npm ERR! network If you are behind a proxy, please make sure that the
08:22:28.925 npm ERR! network 'proxy' config is set properly. See: 'npm help config'
08:22:28.926
08:22:28.926 npm ERR! A complete log of this run can be found in: /opt/buildhome/.npm/_logs/2025-02-27T16_19_54_226Z-debug-0.log
08:22:29.014 Error during NPM install
08:22:29.017 Failed: build command exited with code: 1
08:22:29.718 Failed: error occurred while running build command
08:19:53.000 Started restoring cached node modules
08:19:53.009 Finished restoring cached node modules
08:19:53.335 Installing NPM modules using NPM version 10.5.0
08:22:28.921 npm ERR! code ECONNRESET
08:22:28.921 npm ERR! errno ECONNRESET
08:22:28.923 npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/bn.js: aborted
08:22:28.924 npm ERR! network This is a problem related to network connectivity.
08:22:28.924 npm ERR! network In most cases you are behind a proxy or have bad network settings.
08:22:28.924 npm ERR! network
08:22:28.925 npm ERR! network If you are behind a proxy, please make sure that the
08:22:28.925 npm ERR! network 'proxy' config is set properly. See: 'npm help config'
08:22:28.926
08:22:28.926 npm ERR! A complete log of this run can be found in: /opt/buildhome/.npm/_logs/2025-02-27T16_19_54_226Z-debug-0.log
08:22:29.014 Error during NPM install
08:22:29.017 Failed: build command exited with code: 1
08:22:29.718 Failed: error occurred while running build command
8 Replies
Erisa
Erisa2mo ago
?pages-deployment-id
SuperHelpflare
SuperHelpflare2mo ago
The Pages deployment ID is a unique build identifier. It's the UUID in the browser bar (for example, a URL would be dash.cloudflare.com/ACCOUNT_ID/pages/view/PROJECT/DEPLOYMENT_ID where the deployment ID looks something like a398d794-7322-4c97-96d9-40b5140a8d9b). This ID can help troubleshoot some issues with Pages builds so if you have a failing build make sure you grab that ID for the team to use.
Erisa
Erisa2mo ago
can you share a recent deployment id which had the problem? If youre also comfortable sharing your package.json and package-lock.json files, that would be extremely helpful too
Maxi Ferreira
Maxi FerreiraOP2mo ago
Hi! Yes, here's the deployment ID from the most recent instance today 7e226ebc-92c9-406d-9c8b-c7ea23011e6f This is a monorepo, so there are various package.json files involved, do you need me to send you all of them?
Maxi Ferreira
Maxi FerreiraOP2mo ago
Here's the package-lock.json
Maxi Ferreira
Maxi FerreiraOP2mo ago
We're also running into a few other intermittent issues on our Pages builds. As you'll notice from the package-lock.json, this is quite a big repo that has been slowly but surely growing over time. Is it possible that these issues we're seeing are related to the size of the monorepo?
ale
ale2mo ago
hi @Maxi Ferreira, I've opened a Support case for this. You should soon receive an email related to it 👍
Maxi Ferreira
Maxi FerreiraOP2mo ago
Thank you!

Did you find this page helpful?