crstin
crstin

Reputation: 213

How do I set a custom cache path for Yarn?

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.

Upvotes: 18

Views: 28499

Answers (2)

Emre
Emre

Reputation: 21

That one works for me:

yarn config set cacheFolder '/Users/"username"/.yarn/cache'

yarn cacheFolder

yarn config set

Upvotes: 1

Gerrat
Gerrat

Reputation: 29710

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.

Upvotes: 27

Related Questions