-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
esbuild creates node_modules/.cache
directory in Yarn PnP repo
#2685
Comments
This is needed because esbuild’s package has to run an executable but Yarn sticks everything in zip files, and the OS can’t run an executable when it’s in a zip file. Yarn’s official documentation says to use this folder instead of using esbuild’s package directory, so esbuild is just doing what it’s supposed to do according to the Yarn maintainers: https://yarnpkg.com/advanced/rulebook#packages-should-never-write-inside-their-own-folder-outside-of-postinstall. |
All clear, thanks for the explanation! |
An alternative is for esbuild to tell Yarn to not put esbuild’s packages in zip files. Then esbuild will take up more space on the file system in some cases, but shouldn’t need to create a folder to put the executable in like this. I should probably do that because this isn’t the first time people have complained about this. |
Since esbuild is mostly used as dev dependency anyway, I think the extra space wouldn't matter too much. In any case, thank you for the explanations and considerations. You can consider this closed if you want 👍 |
When I create a Yarn PnP repo and install or run esbuild, it creates a
node_modules/.cache/esbuild
directory containingpnpapi-esbuild-linux-64-0.15.14-esbuild
, even after deleting the directory. Shouldn't it just be able to use Yarn PnP directly?Steps to reproduce:
mkdir test && cd test
yarn init && yarn add --dev esbuild
Versions used:
The text was updated successfully, but these errors were encountered: