如何配置bowerrc文件代理

如何配置bowerrc文件代理,第1张

安装之前检查nodejs如果没安装nodejs按照以下步骤安装$su-$yuminstallopenssl-devel$cd/usr/local/src$wgetprivate-bower-config.json将以下内容粘贴进去:{"port":5678,"registryFile":"./private-bower/bowerRepository.json","disablePublic":false,"publicRegistry":"/packages/","repositoryCache":{"git":{"enabled":true,"cacheDirectory":"./private-bower/gitRepoCache","host":"localhost","port":6789},"svn":{"enabled":true,"cacheDirectory":"./private-bower/svnRepoCache","host":"localhost","port":7891}},"log4js":{"enabled":true,"configPath":"./private-bower/log4js.conf.json"}}$vim/data/private-bower/log4js.conf.json{"appenders":[{"type":"dateFile","filename":"./private-bower/private-bower.log","pattern":"-yyyy-MM-dd","alwaysIncludePattern":false},{"type":"console"}],"replaceConsole":true}启动private-bower$sudosu-$cd/data$private-bower--config./private-bower-config.json[2014-06-3010:00:22.481][INFO]console-[bower]Refreshingpublicpackages[2014-06-3010:00:22.512][INFO]console-[bower]Bowerserverstartedonport5678[2014-06-3010:00:22.538][INFO]console-[bower]Startinggitcacheserver[2014-06-3010:00:22.543][INFO]console-[bower]Startingsvncacheserver[2014-06-3010:01:09.167][INFO]console-[bower]Loadedpublicpackages确保private-bower正常启动:打开一个新窗口来访问:$lynx会显示:ForkmeonGitHubPrivateBower____________________DocsPublicPackagesPrivateBowerserviceisdownNoprivatepackagesregisteredreaddocsabouthowtoregisterpackages.LoadingPackages{{package.name}}hits:{{package.hits}}{{package.repo}}CreatedbyBarnaTothBarnaTóth如果是这样,就安装完毕了客户端测试$sudosu-$npminstall-gbower$su-wlsuser$bowerhelp$vim.bowerrc{"registry":"http://:5678"}$cd$bowerinstalljquery

关于bower

简单的来说就是:

包管理软件,用于前端可以用命令行安装js,如同我们用apt-get install软件一样

安装bower

这里依赖于node以及Npm,所以我们需要安装nodejs,具体可以参见nodejs官网,不过如果是同Mac os或者是Ubuntu的话,可以用类似于

brew install npm

再安装bower

npm install -g bower

安装js包

创建一个简单的配置文件.bowerrc用于配置Bower安装路径

{

"directory": "public/"

}

安装

bower install angularjs

$ bower install angularjs

bower cachedgit://github.com/angular/angularjs.org.git#58ef7908d9

bower validate 58ef7908d9 against git://github.com/angular/angularjs.org.git#*

如果要安装指定版本就是(转载保留:bower install js使用bower管理js)

bower install <name>=<package>#<version></version></package></name>

例如

bower install jquery#1.4


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/12103471.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-21
下一篇 2023-05-21

发表评论

登录后才能评论

评论列表(0条)

保存