Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set a custom cache path for Yarn?

Tags:

yarnpkg

I just installed Yarn and I'm trying to switch from npm.

I tried to set my cache path like this, but it wasn't successful:

yarn --cache-folder /usr/local/Caches/yarn
yarn global --cache-folder /usr/local/Caches/yarn
yarn global cache --cache-folder /usr/local/Caches/yarn
yarn cache --cache-folder /usr/local/Caches/yarn
yarn config set --cache-folder /usr/local/Caches/yarn

Here is the documentation for yarn config.

like image 320
crstin Avatar asked Nov 02 '16 13:11

crstin


1 Answers

The actual command is:

yarn config set cache-folder /usr/local/Caches/yarn

(Note: no preceeding --)

The docs for yarn cache show the various ways this can be set.

like image 169
Gerrat Avatar answered Oct 19 '22 13:10

Gerrat