Use of Bower

Source: Internet
Author: User

First, the installation of Bower

    1. Install the latest version of Nodejs;
    2. Install NPM. Since NPM is a Nodejs package Manager, NPM is automatically installed after the Nodejs installation is complete.
    3. Install Git.
    4. Install Bower. Use NPM Install-g bower for global installation. (Open Webstorm, under terminal window)
    5. Use Bower Help to view Bower commands. However, when you use the Bower install jquery command, you may encounter an error in the following: "Enogit git is not installed or isn't in the PATH", this error occurs because after the GIT installation is complete, there is no The environment variables in your computer add Git's associated bin and cmd directories to the path variable of the system variable, and the only thing we need to do is add the two directories to the path. For example, my Git installation directory is "D:\program files\git\git", then add the following path to path: "D:\program files\git\git\bin;" and "D:\program files\git\git\cmd;", and then restart the computer.                     

Ii. some specific commands of the Bower:

    • Bower Help: View all Bower commands;
    • Bower Init: Is the initialization of a Bower.json file that contains the management of the libraries that are joined using Bower. Similar to the Package.json file in node project;
    • Bower Install <jquery/bootstrap...> [--save-dev or--save]: The module name in the,<> of a module is required, and the qualification in the following [] is optional. Say "--save" "--save-dev" "" "the difference between the three (to install jquery example): 1, Bower install jquery is directly installed, will not be directly written jquery information into Bower.json file; 2, Bower The install jquery--save is to write jquery information directly into the Dependencies section, and--save-dev can reduce the steps of manually modifying Bower.json files; 3, bower install jquery-- Save-dev is to write jquery information directly into the Devdependencies section, but Devdependencies is often used in the development phase to complete the integration test module dependency.
    • Bower uninstall <name>: Uninstalls an installed package;
    • Bower Cache list: Displays a list of cached information for all imported packages;
    • Bower Cache list [name name]: such as Bower cache list jquery angular; Displays a list of cache information for the specified name package.
    • Bower Cache Clean: Clears caches for all packages;
    • Bower Cache Clean [name name]: Clears the buffer for the specified package, with the list usage;
    • Bower Cache Calean [Name#version name#version]: Clears cached information for the specified version of the package;
    • Bower info [name]: Displays information about all versions of the specified package name;
    • Bower info [name#version]: Displays information about the specified version of the specified package;
    • Bower list [-r/-p]: Displays the dependencies of all packages,-r/--relative is displayed in a tree structure,-p/--paths in JSON format (with the path of the package);
    • Bower Lookup [name]: Find the GitHub address of the package by name;
    • Bower Login: Enter your username and password to login to GitHub;
    • Bower search <name>: Query information for a package;
    • Bower Update <name name> [-f/-p]:-F: Force update to the current latest version,-p updates to the production environment and does not update related information in devdependenices.

Now summed up here, feel more than their own to download the fast, very useful management tools. To be continued after ...

Use of Bower

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.