How to Create a bower private library

Source: Internet
Author: User
Tags install openssl

This tutorial applies to centos

Check nodejs before installation. If nodejs is not installed, follow the steps below to install

$ su - $ yum install openssl-devel$ cd /usr/local/src$ wget http://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz$ tar zxvf node-v0.10.29.tar.gz$ cd node-v0.10.29$ ./configure$ make$ make install

Check the version number to see if the installation is successful:
$ node -vv0.10.29


Check git

If not, follow these steps to install

$ sudo yum -y install git

Start to install the bower private library step 1 install git and git-deamon
$ sudo yum install -y git git-daemon

Step 2 install private-Bower
$ sudo npm install -g private-bower

Step 3 set private-Bower
$ sudo su -$ cd /data$ mkdir private-bower$ vim /data/private-bower-config.json


Paste the following content:
{    "port": 5678,    "registryFile": "./private-bower/bowerRepository.json",    "disablePublic": false,    "publicRegistry": "http://bower.herokuapp.com/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}


Start private-Bower
$ sudo su -$ cd /data$ private-bower --config ./private-bower-config.json[2014-06-30 10:00:22.481] [INFO] console - [bower]  Refreshing public packages...[2014-06-30 10:00:22.512] [INFO] console - [bower]  Bower server started on port 5678[2014-06-30 10:00:22.538] [INFO] console - [bower]  Starting git cache server[2014-06-30 10:00:22.543] [INFO] console - [bower]  Starting svn cache server[2014-06-30 10:01:09.167] [INFO] console - [bower]  Loaded public packages




Make sure that private-Bower is started properly:
Open a new window to access:
$ lynx http://localhost:5678/

Will display:

Fork me on GitHub


Private Bower


____________________
Docs public packages
Private bower service is down
No private packages registered read docs about how to register packages.
Loading packages...


{Package. name }}


Hits: {package. Hits }}
{Package. Repo }}


Created


Barnatoth


Barna Tóth


If so, the installation is complete.




Client Test
$ sudo su -$ npm install -g bower$ su - wlsuser$ bower help$ vim .bowerrc{ "registry": "http://<your private repository ip>:5678" }$ cd <testdir>$ bower install jquery


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.