yarn cache

yarn cache list [--pattern]

Yarn stocke chaque package dans un cache global dans votre répertoire utilisateur sur le système de fichiers. yarn cache list affichera chaque package stocké en cache.

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

Exemples :

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

En cours d’exécution yarn cache dir affichera le chemin d’accès où le cache global de Yarn est actuellement stocké.

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.

Modifier le chemin d’accès du cache de Yarn

Changez la valeur cache-folder pour configurer le répertoire de cache.

yarn config set cache-folder <path>

Vous pouvez également spécifier le répertoire de cache avec l’argument --cache-folder :

yarn <command> --cache-folder <path>

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

YARN_CACHE_FOLDER=<path> yarn <command>