标签:
全局安装bower
$ npm install -g bower
检测成功
$ bower help
在项目根目录下进行安装(最新版本),会自动生成一个bower_components文件夹(如果在cmd下会出bug就修改下环境变量,或者用git bash)
$ bower install jquery
列出已安装包列表
$ bower list
搜索包
$ bower search <package name>
查看包信息
$ bower info <package name>
使用bower init
命令来创建bower.json文件
$ bower init
生成如下json
{ "name": "mynode", "description": "", "main": "", "authors": [ "zcynine" ], "license": "MIT", "homepage": "", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "jquery": "^2.2.4", "bootstrap": "^3.3.6" } }
================用cmd使用bower install时出现的bug==============
Bower : ENOGIT git is not installed or not in the PATH
解决方法一:
添加git到window的环境变量中。设置path路径为C:\Program Files\Git\bin
解决方法二:
$ set PATH=%PATH%;C:\Program Files\Git\bin
设置完后需要重启电脑以让变量生效。
Bower : ENOGIT git is not installed or not in the PATH
标签:
原文地址:http://www.cnblogs.com/zcynine/p/5559221.html