bun patch fails if directory patches
already exists
#16502
Labels
bug
Something isn't working
bun install
Something that relates to the npm-compatible client
bun patch
What version of Bun is running?
1.1.45+196621f25
What platform is your computer?
Darwin 24.1.0 arm64 arm
What steps can reproduce the bug?
bun patch
fails when thepatches
directory already exists.Also, it has issues if something from "outside" (like react-native) created a cache directory inside node_modules (like an
android/build
folder)What is the expected behavior?
It should continue and write to it. An existing folder should not be an issue
What do you see instead?
A failure.
or
Additional information
The
EEXIST
error is a "new" issue—at least, I couldn’t find any duplicates. However, the other issue (Permission denied) has been reported twice:bun patch
fails with EACCES Permission denied mkdir() when adding new files in nested directory #13330bun patch
fails to patch node_modules when the patch adds a new directory #13770@Jarred-Sumner asked me to file this issue so that @dylan-conway can "probably fix it next week."
Here it is.
By the way, this is the only blocker for us. Migrating to Bun has been a fantastic experience—it worked seamlessly with React Native/Expo and significantly improved our workflow and CI times.
Please also consider adding an
exclude
pattern tobun patch
so we can ignore folders likeandroid/build
insidenode_modules/@shopify/flash-list/android/build
. These folders are not shipped via npm but are created by React Native during Android builds, causing the permission issue and unnecessarily large patch files.The text was updated successfully, but these errors were encountered: