本教程适用于centos
$ 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
$ node -v v0.10.29
如果没安装,请按照以下步骤安装
$ sudo yum -y install git
$ sudo yum install -y git git-daemon
$ sudo npm install -g private-bower
$ sudo su - $ cd /data $ mkdir private-bower $ vim /data/private-bower-config.json
{ "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 }
$ 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
$ lynx http://localhost:5678/
$ sudo su - $ npm install -g bower $ su - wlsuser $ bower help $ vim .bowerrc { "registry": "http://<your private repository ip>:5678" } $ cd <testdir> $ bower install jquery
原文地址:http://blog.csdn.net/nsrainbow/article/details/35988611