yarn cache

yarn cache list [--pattern]

Yarn stores every package in a global cache in your user directory on the file system. yarn cache list will print out every cached package.

yarn cache list --pattern <pattern> will print out every cached package that matches the pattern provided.

Exemplos:

yarn cache list --pattern gulp
yarn cache list --pattern "gulp|grunt"
yarn cache list --pattern "gulp-(match|newer)"
yarn cache dir

Executar yarn cache dir mostrará na tela o caminho da pasta onde o “cache” global do yarn está arquivado.

yarn cache clean [<module_name>]

Running this command will clear the global cache. It will be populated again the next time yarn or yarn install is run. Additionally, you can specify name of package you want to clean.

Mudar a pasta de “cache” do yarn

Defina o valor de configuração cache-folder (Pasta de “cache”) para configurar a pasta de “cache”.

yarn config set cache-folder <caminho>

Você pode especificar o diretório de cache com a “flag” --cache-folder:

yarn <comando> --cache-folder <caminho>

You can also specify the cache directory by environment variable YARN_CACHE_FOLDER:

YARN_CACHE_FOLDER=<path> yarn <command>