Skip to content
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

bun patch fails if directory patches already exists #16502

Open
hirbod opened this issue Jan 18, 2025 · 0 comments
Open

bun patch fails if directory patches already exists #16502

hirbod opened this issue Jan 18, 2025 · 0 comments
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client bun patch

Comments

@hirbod
Copy link

hirbod commented Jan 18, 2025

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 the patches 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.

error: failed applying patch file: EACCES: android/build/.transforms/81f9bf564efa7258c6d6ab2f84b128c6: Permission denied (mkdir())

or

EEXIST: File or folder exists: failed to make patches dir "patches" (mkdir)

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:

@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 to bun patch so we can ignore folders like android/build inside node_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.

@hirbod hirbod added bug Something isn't working needs triage labels Jan 18, 2025
@RiskyMH RiskyMH added bun install Something that relates to the npm-compatible client bun patch and removed needs triage labels Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client bun patch
Projects
None yet
Development

No branches or pull requests

2 participants