general way to deal with this, which is not language-specific:
Instead of trying to reproduce the bug yourself (by trying many times),
look at the build logs and look at the code, and try to guess how it
Error: missing module import from src/bin/acorn.js for path: acorn
For example: Is it true that the above functions call the other
functions in cascade and the first one (or the last one) tries to load
a module which is missing? How could that happen? That sort of thing.
If you can guess how it may happen by looking at the code and the
build log, you would not even need to reproduce it, but of course this
would be all Knuth style:
"Beware of bugs in the above code; I have only proved it correct, not tried it"
In this case, if you try to prove that the code is correct, you should
surely fail, because we get those build failures which seem to
indicate that it's not.
And if this does not help you in any way, well, I'm really sorry.
I would try to forward the bug upstream anyway. The bug seems real,
as it happens on completely different environments (my autobuilders,
using sbuild, and the ones from reproducible builds, using pbuilder).