bower_cache用法,bower安裝

來源:互聯網
上載者:User

bower_cache用法,bower安裝
bower cache

功能:管理組件緩衝

windows使用者,在C:\Users\dulin\AppData\Local\bower\cache\packages目錄下就是bower安裝過的所有包的緩衝

用法:

$ bower cacheUsage:    bower cache <command> [<args>] [<options>]Commands:    clean                   Clean cached packages    list                    List cached packages

使用list命令列出安裝過的所有包的緩衝

$ bower cache listangular=git://github.com/angular/bower-angular.git#1.3.15angular-animate=git://github.com/angular/bower-angular-animate.git#1.3.15angular-route=git://github.com/angular/bower-angular-route.git#1.3.15angular-touch=git://github.com/angular/bower-angular-touch.git#1.3.15jquery=git://github.com/jquery/jquery.git#2.1.4Mock.js=git://github.com/nuysoft/Mock.git#0.1.9

使用clean命令清除安裝過的所有包的緩衝

$ bower cache cleanbower deleted       Cached package angular: C:\Users\dulin\AppData\Local\bower\cache\packages\ef2188def21eb1bbd1f1792311942a53\1.3.15bower deleted       Cached package angular-touch: C:\Users\dulin\AppData\Local\bower\cache\packages\8926838ac25d624594e3d6618381d070\1.3.15bower deleted       Cached package angular-route: C:\Users\dulin\AppData\Local\bower\cache\packages\a79b04bbe7ddc8d7be946d2012fca5b7\1.3.15bower deleted       Cached package angular-animate: C:\Users\dulin\AppData\Local\bower\cache\packages\1e5d36753a7672512aa68fc8cdf5a6ce\1.3.15bower deleted       Cached package jquery: C:\Users\dulin\AppData\Local\bower\cache\packages\fe2fe255e91d251051d543998aa8327a\2.1.4bower deleted       Cached package Mock.js: C:\Users\dulin\AppData\Local\bower\cache\packages\c6f933bc2d5129e99678e3ca643531ad\0.1.9

再次使用list命令查看,包的緩衝已經被清理刪除了

$ bower cache list

進入C:\Users\dulin\AppData\Local\bower\cache\packages查看,緩衝的包檔案確實被刪除了。

從本機快取中安裝包:

bower支援離線,從本機快取中安裝包,前提是緩衝中有這個包。

離線安裝包:

$bower install <package> --offline

補充:

查看指定包名的緩衝,只需要指定包名就可以了,例如

$ bower cache list jqueryjquery=git://github.com/jquery/jquery.git#2.1.4

查看多個指定包名的緩衝,包名之間用空格分隔

$ bower cache list jquery Mock.jsjquery=git://github.com/jquery/jquery.git#2.1.4Mock.js=git://github.com/nuysoft/Mock.git#0.1.9

說明:=號前面的是包名,#號後面的是包的版本。查看指定包名的緩衝,在一個包存在多個版本時有用。

同理,清除指定包的緩衝

$ bower cache clean jquerybower deleted       Cached package jquery: C:\Users\dulin\AppData\Local\bower\cache\packages\fe2fe255e91d251051d543998aa8327a\2.1.4

清除指定版本的包的緩衝,需要在包名後加#<version>

$ bower cache clean jquery-ui#1.11.4bower deleted       Cached package jquery-ui: C:\Users\dulin\AppData\Local\bower\cache\packages\3725aca888af41d0b2de2b0b81f8307b\1.11.4

清楚多個指定版本的包的緩衝,包名之間用空格分隔

$ bower cache clean jquery#2.1.4 Mock.js#0.1.9bower deleted       Cached package jquery: C:\Users\dulin\AppData\Local\bower\cache\packages\fe2fe255e91d251051d543998aa8327a\2.1.4bower deleted       Cached package Mock.js: C:\Users\dulin\AppData\Local\bower\cache\packages\c6f933bc2d5129e99678e3ca643531ad\0.1.9

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.