Bower Custom Installation:
Installing bower requires first installing Node,npm,git
Global installation Bower, command: NPM install-g Bower
Enter the project directory, create a new file 1.txt
Then the command line enters the project directory, and the input command renames the file as. BOWERRC:
Modify file name, command: Rename 1.txt. BOWERRC
* Explain why the command line to modify the file name, because the direct modification of the computer is not allowed to modify Ah, the above command for window~~
The contents of the. bowerrc file are populated as follows: (Js/lib is the path that is stored by the Bower downloaded file, set by itself)
{
"Directory": "Js/lib"
}
Bower initialization, command: Bower Init
After executing the initialization command, you can directly enter the command line to modify the configuration information, do not modify the direct return
After initialization, a Bower.json configuration file is generated
Bower Basic Usage: (Package management tool)
Package installation, such as jquery, command: Bower install jquery--save
Package information, command: Bower info jquery
Update for package, command: Bower update
Package lookup, Command: Bower search jquery
Uninstall of package, command: Bower uninstall jquery
Bower Usage Related instructions:
Bower installation, such as jquery, it will download the latest jquery version from remote to your Js/lib directory
Where the--save parameter is to save the configuration to your Bower.json, you will find that the Bower.json file is already one line longer:
* Note that if the installation is prompt: Git is not installed or not in the PATH
* You're pretty sure that your git is installed, and that's because your git doesn't have environment variables set,
* Set the method to add git to the environment variable in window. Set the path path to C:\Program Files\git\bin
* Here's C:\Program files\git\bin refers to your git installation directory, according to your own git installation directory settings
* Set the environment variable to take effect after setting the completion environment variable
* Immediately effective direct DOS input: SET path=c:\, close the DOS window can be modified here will not really modify the original PATH, you can rest assured that the use of
* Turn off all previous command-line windows and re-enter the corresponding directory to execute the package installation command.
Find out which versions of jquery are available, execute a command to see the Bower.json information for jquery, and the version information you can use
If you want to update the package, Bower will automatically pull the latest version if you have the latest version of the file after the direct command executes.
Manually modify the Bower.json inside the file version, execute the update command, you can get the version of the file you want
Find and delete to be clear
The model for the basic installation configuration is probably the bottom:
12345678910111213141516171819202122 |
{
"name"
:
"bb_boot"
,
"version"
:
"0.0.1"
,
"authors"
: [
"savokiss <[email protected]>"
],
"moduleType"
: [
"amd"
],
"license"
:
"MIT"
,
"ignore"
: [
"**/.*"
,
"node_modules"
,
"bower_components"
,
"js/lib"
,
"test"
,
"tests"
],
"dependencies"
: {
"jquery"
:
"~2.1.4"
}
}
|
Bower installation use Getting Started details