Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Yarn directly assumes it can use the cache folder and goes ahead to create it. The thing is, sometimes even if it can create the folder, it may not be able to write into it or read from it. Even more, the creation is also not guaranteed and there are no safe guards for this. Thus, if for some reason this fails, yarn falls flat on its face.
If the current behavior is a bug, please provide the steps to reproduce.
Try running yarn --cahe-folder=/root/.yarn-cache
as a normal user for instance.
What is the expected behavior?
Yarn should detect the issue right from the start and send out a clear message. Even better: print a warning about the cache folder not being usable and falling back to the system-provided tmp folder so things work properly.
Please mention your node.js, yarn and operating system version.
Latest master.