Skip to content
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

If the cache folder is in an inaccessible place, yarn will fail every command #8086

Open
BernardoFBBraga opened this issue Apr 28, 2020 · 2 comments

Comments

@BernardoFBBraga
Copy link

Bug description

yarn gets locked into an unusable state if the cache location is inaccessible, no commands work (not even yarn --version or yarn --help), meaning yarn config set cache-folder doesn't work and the problem can't be fixed using the cli.

The following error message is shown:

error An unexpected error occurred: "EACCES: permission denied, mkdir '/media/usr/Data'".
info If you think this is a bug, please open a bug report with the information provided in "/home/usr/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/help for documentation about this command.

Only by editing the .yarnrc file the bug can be fixed.

Command

yarn config set cache-folder

What is the current behavior?
yarn gets locked in an unnusable state

What is the expected behavior?
yarn should be able to be configured out of an invalid state without manual setting of auto-generated files

Steps to Reproduce
1- set the yarn cache folder using the command yarn config set cache-folder /media/usr/Data/.yarn-cache
2- unmount the device
3- any yarn command will fail, including yarn config set cache-folder

Only solution currently is setting changing the config manually in the ~/.yarnrc file

Environment

  • Node Version: v12.1.0
  • Yarn v1 Version: 1.17.3
  • OS and version: Linux Mint 19.3 Tricia
@aabmets
Copy link

aabmets commented Sep 13, 2022

It's 2022 and this is still an issue, the entire yarn package manager has become completely fucked up. Nothing helps, not reinstalling node, absolutely nothing. I delete all yarn files and reinstall node and re-enable corepack and this is still fucked up. What the fuck is this?

@Cameron-Webster
Copy link

Having a similar issue on a read-only file system, setting --cache-folder to a writable folder does not not work, with error:

warning Skipping preferred cache folder "/home/node/.cache/yarn" because it is not writable.
warning Skipping preferred cache folder "/tmp/.yarn-cache-1000" because it is not writable.
warning Skipping preferred cache folder "/tmp/.yarn-cache" because it is not writable.
error Yarn hasn't been able to find a cache folder it can use. Please use the explicit --cache-folder option to tell it what location to use, or make one of the preferred locations writable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants