如何为 Yarn 设置自定义缓存路径? [英] How do I set a custom cache path for Yarn?
本文介绍了如何为 Yarn 设置自定义缓存路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚安装了 Yarn,我正在尝试从 npm 切换.
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
这是有关纱线配置的文档.
推荐答案
实际命令是:
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.
这篇关于如何为 Yarn 设置自定义缓存路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文