bun icon indicating copy to clipboard operation
bun copied to clipboard

`bun install` occasionally fails with parallel runs

Open pistazie opened this issue 1 year ago • 5 comments

What version of Bun is running?

1.1.21

What platform is your computer?

linux / macOS

What steps can reproduce the bug?

    echo run1 run2 run3 run4 run5 | xargs -n 1 -P 5 sh -c 'bun install'

What is the expected behavior?

It would be great if bun can run parallel. I guess there is some central contention, maybe it can be resolved using locks.

What do you see instead?

No response

Additional information

When bun is parallelly ran (on multiple projects to save time), it tends to fails for some of the executions.

The error message(s) are of the pattern: error: Failed to link {npm-package-name}: EEXIST

pistazie avatar Jul 29 '24 13:07 pistazie

We have tests for this, but the tests focus on install rather than linking bins. cc @dylan-conway

Jarred-Sumner avatar Jul 29 '24 14:07 Jarred-Sumner

I am experiencing this using @sentry/cli

One example from docs:

thomas: error: Failed to link @sentry/cli: EEXIST
polar: Saved lockfile
polar: error: could not determine executable to run for package @sentry/cli

To try and get around it I run bunx @sentry/cli --version not in parallel at the start of CI to install it so later bunx runs shouldn't try and re-install but maybe thats not doing what I want it to.

This just started happening even though this code hasn't changes in quite a while, if I downgrade bun will it work?

Note: This is our production pipeline.

yharaskrik avatar Jul 30 '24 14:07 yharaskrik

Still hitting this issue.

jtszalay avatar Dec 03 '25 15:12 jtszalay

maybe do: bun i --force

suse-coder avatar Dec 19 '25 10:12 suse-coder

We need to find root cause of that issue. https://github.com/link-assistant/agent/pull/73 can be used for reference.

konard avatar Dec 19 '25 21:12 konard