The current behavior of yarn config set cache-folder [dir] does not act as expected - when you declare the dir arg, is is not treated as a relative dir like most unix unix commands do, rather it is added to a shared dir. This can be circumvented by prefixing $(pwd).
Command
cd /
yarn config set cache-folder .yarn-cache
What is the current behavior?
Cache folder is set to /usr/local/share/.yarn-cache
What is the expected behavior?
Cache folder is set to /.yarn-cache/v6
Steps to Reproduce
➜ docker run -it node:alpine sh
/ # yarn config set cache-folder .yarn-cache
yarn config v1.22.4
success Set "cache-folder" to ".yarn-cache".
Done in 0.04s.
/ # yarn cache dir
/usr/local/share/.yarn-cache/v6
/ # yarn config set cache-folder $(pwd)/.yarn-cache
yarn config v1.22.4
success Set "cache-folder" to "//.yarn-cache".
Done in 0.05s.
/ # yarn cache dir
/.yarn-cache/v6
Bug description
The current behavior of
yarn config set cache-folder [dir]
does not act as expected - when you declare thedir
arg, is is not treated as a relative dir like most unix unix commands do, rather it is added to a shared dir. This can be circumvented by prefixing$(pwd)
.Command
What is the current behavior?
Cache folder is set to /usr/local/share/.yarn-cache
What is the expected behavior?
Cache folder is set to /.yarn-cache/v6
Steps to Reproduce
Environment
v14.4.0
1.22.4