Member-only story
I Tested Yarn’s Performance: 4x Faster Than NPM, with No Node_Modules
Yarn was 4x faster than NPM in my local testing. And, ya know what I love? Only 1MB of Yarn pnp files committed to my repository instead of a 563MB local node_modules
folder.
Here’s how long it takes me to run yarn
in one Next.js project that I’m actively developing, and one where I’ve already set up modern Yarn.
One thing to note is that because I’m using the recommended Yarn setting of compressionLevel
of 0
, I had to Git ignore uploading the Next.js binary as part of the Yarn cache by changing my .gitignore
file.
That baby is over 100MB uncompressed, and GitHub says no.
Actually, Github says, “Buy Git Large File Storage (LFS).”
They are owned by Microsoft.
Anyway, my point is that there is 1 file that isn’t cached and needs to be built on my system, so this isn’t an “optimal” Yarn caching situatoin.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 482ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ sharp@npm:0.30.4 must be built because it never has been…