Currently Netlify does a few things that are bad for Yarn 2 users:
- Caches the
node_modules
directory regardless of the configured YarncacheFolder
- Uses the deprecated
cache-folder
option, which will throw aYN0050
error
The most annoying consequence of this is that every time one of my Yarn 2 projects is built it downloads 2 copies of the dependencies, every single build (one from Netlify cache, one from Yarn 2). This results in much longer builds as there is now effectively 0 caching of dependencies.
The Netlify build image should be updated to better handle projects that use Yarn 2.