Skip to content

fix(pnpm): allow EBUSY when deleting node_modules #6826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 26, 2025

Conversation

lizthegrey
Copy link
Contributor

@lizthegrey lizthegrey commented Jun 18, 2025

What's the problem this PR addresses?

EBUSY should be allowed, if node_modules is an active docker mountpoint where rmdir attempts to unmount it which fails because there are open files.

Closes #4373 #4974 #4259 #1184 #4172

How did you fix it?

Allow EBUSY to not block "clearing" node_modules.

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

lizthegrey and others added 2 commits June 17, 2025 18:11
EBUSY should be allowed, if we currently have file handles open inside the directory that deletion is attempted on (for instance if something has node_modules/.cache open, or if node_modules/.cache contains the pnpmStoreFolder)
@arcanis arcanis merged commit 3321522 into yarnpkg:master Jul 26, 2025
26 checks passed
@lizthegrey lizthegrey deleted the patch-1 branch July 26, 2025 11:34
Saadnajmi pushed a commit to Saadnajmi/berry that referenced this pull request Jul 26, 2025
## What's the problem this PR addresses?

EBUSY should be allowed, if `node_modules` is an active docker
mountpoint where rmdir attempts to unmount it which fails because there
are open files.

Closes yarnpkg#4373 yarnpkg#4974 yarnpkg#4259 yarnpkg#1184 yarnpkg#4172 

## How did you fix it?

Allow EBUSY to not block "clearing" node_modules.

## Checklist

- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [ ] I have set the packages that need to be released for my changes to
be effective.
- [ ] I will check that all automated PR checks pass before the PR gets
reviewed.

---------

Co-authored-by: Maël Nison <[email protected]>
@lizthegrey
Copy link
Contributor Author

Oh, thanks for taking it over the line, y'all <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug?]: Yarn 3.2 breaks node_modules with docker volumes
2 participants