在 Ubuntu 上安装 Bower 的方法
Bower 是 Web 的捆绑主管,并为入口完成包管理中的缺点提供了一种传统技术。它基本上维护和监控所有包,并检查新更新。Bower 还使用名为 bower.json 的发生文件来跟踪应用程序。本文解释了“如何在 Ubuntu 上安装 Bower”。
要安装 Bower,我们需要预安装 Node.js 和 NPM。要验证 node.js 版本,请使用以下命令 -
$ node -v
示例输出应如下所示 -
v6.9.2
要验证 NPM 版本,请使用以下命令
$ npm -v
示例输出应如下所示 -
3.10.9
如果要安装 Node.js 和 NPM,请阅读本文
要安装 Bower,请使用以下命令 -
$ sudo npm install -g bower
示例输出应如下所示 -
/usr/bin/bower -> /usr/lib/node_modules/bower/bin/bower /usr/lib `-- [email protected]
要获取更多有关 Bower 的信息,请使用以下命令 -
Usage: bower [] [] Commands: cache Manage bower cache help Display help information about Bower home Opens a package homepage into your favorite browser info Info of a particular package init Interactively create a bower.json file install Install a package locally link Symlink a package folder list List local packages - and possible updates login Authenticate with GitHub and store credentials lookup Look up a single package URL by name prune Removes local extraneous packages register Register a package search Search for packages by name update Update a local package uninstall Remove a local package unregister Remove a package from the registry version Bump a package version Options: -f, --force Makes various commands more forceful -j, --json Output consumable JSON -l, --loglevel What level of logs to report -o, --offline Do not hit the network -q, --quiet Only output important information -s, --silent Do not output anything, besides errors -V, --verbose Makes output more verbose --allow-root Allows running commands as root -v, --version Output Bower version --no-color Disable colors See 'bower help ' for more information on a specific command.
要使用 Bower 安装 bootstrap,请使用以下命令 -
$ bower install git://github.com/twbs/bootstrap
示例输出应如下所示 -
bower not-cached git://github.com/twbs/bootstrap.git#* bower resolve git://github.com/twbs/bootstrap.git#* bower download https://github.com/twbs/bootstrap/archive/v3.3.7.tar.gz bower progress bootstrap#* received 0.1MB of 4.0MB downloaded, 3% bower progress bootstrap#* received 0.2MB of 4.0MB downloaded, 4% bower progress bootstrap#* received 0.2MB of 4.0MB downloaded, 4% bower progress bootstrap#* received 0.2MB of 4.0MB downloaded, 5% bower progress bootstrap#* received 0.2MB of 4.0MB downloaded, 5% bower progress bootstrap#* received 0.2MB of 4.0MB downloaded, 6% bower progress bootstrap#* received 0.3MB of 4.0MB downloaded, 6% bower progress bootstrap#* received 0.3MB of 4.0MB downloaded, 7% .....................................................................
阅读完本文后,你将能够了解如何在 Ubuntu 上安装 Bower。在我们的下一篇文章中,我们将提出更多基于 Linux 的技巧和提示。继续阅读!
广告