Frequent/intermittent NPM install failures

When we run our integrations, we continuously get random failures on npm installs, almost as if our connection gets throttled and/or cut off.

It’s severely hampering our releases and it’s been going on for ages now.

We’ve reached out before to no avail, so I hope filing this bug will at least get someone to look at what’s going on.

This happens in the image build phase and there are no artifacts.

Search this forum for NPM issues - I assume you mean the “Too long with no output message” at the end. One of the posts here points to a bug logged on the NPM GitHub Issues section. AFAICR it’s a networking issue between NPM and various CI providers.

Is this intermittent for you, or does this fail reliably every time?

Thanks, it fails randomly. Some days it will fail 90% of the time, some days it will be no issue.

Fair enough. If I were fixing this, I’d write a script (Bash/Python/whatever) to:

  • Try NPM operations with a timeout
  • If they fail, pause and retry, up to a predefined limit

This may be a bit hacky, and it may still fail completely, but perhaps more builds will go through than do at present.

I’d add that if this is an ongoing issue, it’s a business risk that you need to address. Could you set up an NPM proxy that contains copies of the dependencies you need? Of course, this “should not” be necessary, but… :slightly_smiling_face:

I doubt that will happen, to be honest. If you can prove it’s a CircleCI problem, then I’d expect them to look into it, but presently I don’t think that is certain, and the issue needs more digging on your side. (I can’t speak for them, but like web hosts, there is only so much stuff outside of their network that support staff can be responsible for).