如何更改Bower的默认缓存文件夹

如何更改Bower的默认缓存文件夹

本文介绍了如何更改Bower的默认缓存文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 在* nix上,bower将〜/ .bower 文件夹用于其缓存(软件包等)。 我想更改 凉亭规格文档建议我在 .bowerrc 存储键c>。 我已经在项目文件夹中创建了一个,就像这样: { storage:{ cache:〜/ blah / cached, git:〜/ blah / git_templates } } 运行高级安装-i 看到它仍然尝试保存到〜/ .bower 。 有人可以告诉我我是什么吗这里做错了吗?和/或是否有其他方法可以更改位置?解决方案在尝试根据规范,我放弃了... 所以我在github上回顾了 bower 的历史,发现: 在 v0.10.0 之前,Bower使用 config.cache ( lib / core / ResolveCache.js )作为其缓存位置 此后,satazor重写了Bower的核心,现在开始使用 config.storage.cache ,我打赌规范文档当时已编写。根据规范: 但是,在此提交,satazor现在使用 config.storage.packages 代替config.storage.cache 之后,在 v1中。在0.0 版本中, config 始终设置为config.storage.packages,但自此以后,该规范就没有反映出这一变化 解决方案 导出环境变量 bower_storage__packages 使用 .bowerrc 例如: { storage:{ packages: / path /到/缓存 } } PS:我认为在G中链接规范文档oogle Docs不是一个好主意,也许github是一个更明智的选择(因为我们可以发出请求请求)。 On *nix, bower uses the ~/.bower folder for its cache (packages and so on).I would like to change this to a different location.The bower spec document from suggests that I configure the storage key in my .bowerrc.I have created one in my project folder like so:{ "storage": { "cache": "~/blah/cached", "git": "~/blah/git_templates" }}When running bower install - i see that it still tries to save into ~/.bower.Can anyone tell me what I am doing wrong here ? And/or if there is a different way to change the location ? 解决方案 I had the same problem, after some tries according the spec, I gave up...So I reviewed bower's history on github and found:Before v0.10.0, bower used config.cache (lib/core/ResolveCache.js) for its cache locationAfter that, satazor rewrote bower's core, now using config.storage.cache at the beginning, i bet the spec doc was written at this time. From the spec:However, after this commit, satazor now uses config.storage.packages instead of config.storage.cacheAfter that, in the v1.0.0 release, the config is always set to config.storage.packages, but the spec has not reflected this change ever sinceSolutionExport the environment variable bower_storage__packagesUse a .bowerrc such as:{ "storage":{ "packages":"/path/to/cache" }}P.S.: I think that linking the spec doc in Google Docs isn't a good idea, maybe github would be a more sensible choice (since we can issue pull requests). 这篇关于如何更改Bower的默认缓存文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-06 14:14