Open LucyEgan opened 3 weeks ago
1.1.26+0a37423ba
Linux 5.15.153.1-microsoft-standard-WSL2 x86_64 x86_64
Save the following package.json in a empty dir
package.json
{ "name": "bun-test", "module": "index.ts", "type": "module", "dependencies": { "polyfill-library": "^4.8.0" } }
Install with bun Run bun i
bun i
Start patch Run bun patch polyfill-library
bun patch polyfill-library
Add a new directory into node_module Run mkdir node_modules/polyfill-library/polyfills/__dist/Test
mkdir node_modules/polyfill-library/polyfills/__dist/Test
Add a new file into node_module Run echo '{}' > node_modules/polyfill-library/polyfills/__dist/Test/meta.json
echo '{}' > node_modules/polyfill-library/polyfills/__dist/Test/meta.json
Complete patch Run bun patch --commit 'node_modules/polyfill-library'
bun patch --commit 'node_modules/polyfill-library'
^^ When completing the patch it will return
bun patch v1.1.26 (0a37423b) error: failed applying patch file: EACCES: polyfills/__dist/Test: Permission denied (mkdir()) Checked 229 installs across 244 packages (no changes) [494.00ms] error: failed to apply patchfile (patches/polyfill-library@4.8.0.patch)
To patch the node_modules/package directory and not the top level directory
node_modules/package
A patch of the top level directory polyfills as a corrupted by permissions directory, once permissions are sorted then its a empty directory
polyfills
Patching works when creating a new file in the node_module just not when it had a new directory
node_module
I'm seeing this too on 1.1.126 on MacOS. Anyone got a workaround? I know it's possible to make a new node_module based on a patched fork, but that defeats the purpose of "bun patch" entirely lol
What version of Bun is running?
1.1.26+0a37423ba
What platform is your computer?
Linux 5.15.153.1-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
Save the following
package.json
in a empty dirInstall with bun Run
bun i
Start patch Run
bun patch polyfill-library
Add a new directory into node_module Run
mkdir node_modules/polyfill-library/polyfills/__dist/Test
Add a new file into node_module Run
echo '{}' > node_modules/polyfill-library/polyfills/__dist/Test/meta.json
Complete patch Run
bun patch --commit 'node_modules/polyfill-library'
^^ When completing the patch it will return
What is the expected behavior?
To patch the
node_modules/package
directory and not the top level directoryWhat do you see instead?
A patch of the top level directory
polyfills
as a corrupted by permissions directory, once permissions are sorted then its a empty directoryAdditional information
Patching works when creating a new file in the
node_module
just not when it had a new directory