一 node 安裝javascript
打開https://nodejs.org/en/ nodejs官網 下載安裝文件 雙擊.pkg 文件 自動安裝便可java
二 安裝gitnode
打開 http://code.google.com/p/git-osx-installer/ 下載最新的PGK文件 雙擊.pkg 文件 自動安裝便可。(注:可能遇到 信任問題 能夠在 系統偏好設置->安全性與隱私->容許從如下位置下載的應用 選擇繼續安裝)jquery
github使用SSH連接,須要設置SSHgit
1.檢查SSH keygithub
cd ~/.sshshell
2.備份已有的key,(若是有的話)npm
mkdir key_backupgulp
mv id_rsa* key_backup安全
3.生成SSH key
$ ssh-keygen -t rsa -C sunjianping88@126.com
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/sunjianping88/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): //###這個地方是設置密碼 輸入本身要設置的密碼便可 也能夠不輸入
Enter same passphrase again:
Your identification has been saved in yes.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx sunjianping88@126.com
The key's randomart image is:
+---[RSA 2048]----+
|..+= .=B**+*o |
|o o . oo+=o.o |
| . ... o *.. |
| .oE . o = + |
|oo... o S |
|= . . . |
|oo |
|=o. |
|B+ |
+----[SHA256]-----+
4.將SSH key添加到GitHub
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2ExxxzzzzzzQABAAABAQDv7Yb10i+bV5S5sueGVP9NRYYcUKpx+A/IPZS0ZWId469SaIW9ajrGNFSlIwxxxxxxxmhvCGI9nY4c3uD4m3dJvo+EfGduEya4uZS2gPNmZ7osmV6TCdgfTVUqlifK1/rzt0iEyriM8BcIeh+lxb3m/fU+6vuxteqEiHAUArt2dxxxxxxxxxrZxxSNq8He8t+/wSkusCxxxCaoNobxxxxUZHauol7ybqnaNGhW3oTlNnd08RfMv16MtAlKrX5Gvy2jyxchjxXXeL6tQvxxxxxeUyXaLcVSMw+JKLaUHJRG6eBt2rnNvTd35ALx1ObI/qTMxxxxxxxx0jmMhmEVKxshbn sunjianping88@126.com
登陸到GitHub頁面,personal settings ->SSH and GPG Keys->New SSH key
將生成的key(id_rsa.pub文件,即上面命令cat ~/.ssh/id_rsa.pub獲取文件的內容)內容copy到輸入框中,點擊Add SSH key。
5.測試連接
$ ssh git@github.com
The authenticity of host 'github.com (192.30.252.122)' can't be established.
RSA key fingerprint is SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.122' (RSA) to the list of known hosts.
Saving password to keychain failed
Identity added: /Users/sunjianping/.ssh/id_rsa ((null))
PTY allocation request failed on channel 0
Hi sunjp748! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
出現上述提示信息說明鏈接成功(github並不提供shell登錄但已經鏈接成功)
6.設置我的信息
$ git config --global user.name "your_name"
$ git config --global user.email your_email@xxx.com
三 bower安裝
1.輸入命令
$ sudo npm install -g bower
/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
bower@1.7.9 /usr/local/lib/node_modules/bower
2.新建.bowerrc文件 設置下載文件的保存目錄
(1)能夠在項目根目錄下新建一個txt文件 而後mv x.txt .bowerrc
(2)修改.bowerrc文件內容爲
{
"directory" : "public/javascripts/lib"//要保存下載庫文件的目錄
}
3.進入項目目錄中,輸入命令以下 bower init 而後按照提示填寫內容便可 遇到選擇Y/n的選擇Y便可
4.嘗試下下載文件
$ bower install jquery --save
bower not-cached https://github.com/jquery/jquery-dist.git#*
bower resolve https://github.com/jquery/jquery-dist.git#*
bower checkout jquery#2.2.4
bower progress jquery#* Receiving objects: 26% (35/133), 220.00 KiB | 105.00 KiB/s
bower resolved https://github.com/jquery/jquery-dist.git#2.2.4
bower install jquery#2.2.4
jquery#2.2.4 public/javascripts/lib/jquery
出現以上內容證實已經部署成功
(未完待續 gulp構建工具)