Skip to content

Commit 3321522

Browse files
lizthegreyarcanis
andauthored
fix(pnpm): allow EBUSY when deleting node_modules (#6826)
## 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 - [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]>
1 parent 10fdde7 commit 3321522

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.yarn/versions/5ccd3d41.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
releases:
2+
"@yarnpkg/cli": patch
3+
"@yarnpkg/plugin-pnpm": patch
4+
5+
declined:
6+
- "@yarnpkg/plugin-compat"
7+
- "@yarnpkg/plugin-constraints"
8+
- "@yarnpkg/plugin-dlx"
9+
- "@yarnpkg/plugin-essentials"
10+
- "@yarnpkg/plugin-init"
11+
- "@yarnpkg/plugin-interactive-tools"
12+
- "@yarnpkg/plugin-nm"
13+
- "@yarnpkg/plugin-npm-cli"
14+
- "@yarnpkg/plugin-pack"
15+
- "@yarnpkg/plugin-patch"
16+
- "@yarnpkg/plugin-pnp"
17+
- "@yarnpkg/plugin-stage"
18+
- "@yarnpkg/plugin-typescript"
19+
- "@yarnpkg/plugin-version"
20+
- "@yarnpkg/plugin-workspace-tools"
21+
- "@yarnpkg/builder"
22+
- "@yarnpkg/core"
23+
- "@yarnpkg/doctor"

packages/plugin-pnpm/sources/PnpmLinker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ async function removeIfEmpty(dir: PortablePath) {
399399
try {
400400
await xfs.rmdirPromise(dir);
401401
} catch (error) {
402-
if (error.code !== `ENOENT` && error.code !== `ENOTEMPTY`) {
402+
if (error.code !== `ENOENT` && error.code !== `ENOTEMPTY` && error.code !== `EBUSY`) {
403403
throw error;
404404
}
405405
}

0 commit comments

Comments
 (0)