3 ms·
I was a yarn 2+ convert because of how much faster installs were (and the corresponding reduced disk bloat). It unfortunately doesn't play well with Angular, an
by swsieber 3y ago
I was a yarn 2+ convert because of how much faster installs were (and the corresponding reduced disk bloat). It unfortunately doesn't play well with Angular, and lots of people fall back to the "node_modules" strategy which does away with much of the benefits.
Is there any good comparison out there of the JS package managers, and the trade-offs they make? I happen to really like the disk/time vs compatibility trade-off yarn 2 makes, but not the zero-install (which had been the default for a time). But hearing that Bun is faster, and better ergonomics? And other people mentioning pnpm? That makes want a package manager in depth comparison.
- swsieber 3y agoI want to take a minute on rant about the insanity that is having node_modules used a caching location. That's the big reason for the incompatibility for between npm and any package manager that attempts to clean up the node_modules mess (though the impact varies by solution). Maybe I'm just spoiled, coming from java, where you can expect your libraries to be in a read-only archive, and that tools separate the runtime from their cache.
- 5e92cb50239222b 3y agoJust use pnpm. It uses the same node_modules so you get 100% compatibility with all sorts of frameworks/build systems/IDEs, but stores all files in a single global content-addressable directory, and hardlinks everything from there (or reflinks if your filesystem supports it). It also hides indirect dependencies so you don't import them accidentally (you can still use a flattened directory if you need it). If you install libfoo@1.0.0 and libfoo@1.0.1 and the only difference between them is a single file, the second copy will only add that file to disk. If you then install that libfoo@1.0.0 into a hundred projects spread across your disk, no files will be copied (both reflinks and hardlinks only add a bit of filesystem metadata). https://pnpm.io/feature-comparison https://pnpm.io/feature-comparison https://github.com/pnpm/pnpm#benchmark https://github.com/pnpm/pnpm#benchmark