We are developing a toolset of components which are available through bower. When we looked at the Polymer components we noticed that they make use of 'bower install Polymer/Module'
My question is how do they manage to work with these "submodules" in Bower?
The user/package format is not specific to Polymer, it is a feature of the bower install command. It is a shorthand for a Git repository, and Bower defaults to GitHub.
bower install polymer/core-icon
is the same as
bower install https://github.com/polymer/core-icon.git
Related
From the project's README:
Multiple Registries: Install any package from either npm or Bower and keep your package workflow the same.
I'm assuming that means that I can install my Bower packages (listed in my project's bower.json) with Yarn. If this is the case, how would I go about doing that?
I'm not seeing any mention of Bower or using separate registries in the documentation. However, I do see the Bower registry listed in the source.
UPDATE 11/4/16: Yarn decided to remove support for Bower. See the Github pull request and Bower's blog. =(
ORIGINAL:
Bower just posted a blog post about this topic. They seem excited about it, but point out that there are currently unresolved issues:
Important note: As it stands right now there still seem to be some issues regarding Bower support. We are however confident that with the help of the community, these issues will be solved quickly as Yarn steps towards 1.0 in upcoming months.
He also refers to a pull request for a bower patch.
When I ran yarn, it deleted my bower_components folder (GitHub ticket here)! I really like yarn though, can't wait for the bower bugs to get resolved.
If you add the following to package.json, bower install will be called and it works. It is a workaround though:
"scripts": {
"postinstall": "bower install"
}
Apparently, it should just work. Unfortunately, there's currently a bug where, if you have both a package.json and bower.json in the same project, only the npm packages are installed and the bower packages are ignored.
Normally, one would simply yarn or yarn install and both npm and bower dependencies would be installed.
As a part of our TFS build process, we have to install node components including bower and run bower to get the required client side libraries. Then we have to run gulp to perform a bunch of other tasks.
But when I try to install bower and then perform bower install either as a Post-build event or Gulp task, I get the error
##[error]call npm install
##[error]call npm install bower
##[error]call bower install
##[error]call gulp"
Error: Can't install! bower doesn't seem to be installed.
We deploy to our TFS Build server using a service account. We cannot login to the server using the service account.
You might want to try using the NPM task in the TFSBuild script.
Documentation for it can be found here
https://msdn.microsoft.com/en-us/Library/vs/alm/Build/steps/package/npm-install
I'm new to js package managers and build tools so this seems a bit confusing to me.
I've set up a new ember app and I want to add the dependencies (foundation) in the recommended/conventional way. There seem to be two ways of adding this to your project, using bower or broccoli.
This page recommends using broccoli:
If you want to use the .scss version of Foundation, you should first configure your project to use broccoli-sass with:
npm install --save-dev broccoli-sass
and then rename your app/styles/app.css to app/styles/app.scss.
Then you can install Foundation using Bower with:
bower install --save-dev foundation
Now, inside your app/styles/app.scss, you can import the Foundation styles with:
#import 'bower_components/foundation/scss/normalize';
#import 'bower_components/foundation/scss/foundation';
whereas this recommends using bower.
$> bower install --save bootstrap
Afterwards add following two lines to your ember-cli-builds.js (or Brocfile.js if you are using an older version of Ember.js):
app.import(app.bowerDirectory + '/bootstrap/dist/js/bootstrap.js');
app.import(app.bowerDirectory + '/bootstrap/dist/css/bootstrap.css');
Could someone shed some light on what the difference between these is and which one is the better/recommended way?
Official ember-cli documentation recommends to use bower: "Ember CLI uses Bower for dependency management"
I installed package with bower.
This package has dependency of another package, but bower doesn't know it.
How do I manually add installed package dependency to be something in bower.json file?
There is no official way of doing this so here are a number of solutions:
fork the project on on github for example, add the correct dependencies in bower.json and use that repo in your own project (optionally you can then issue a pull request to the origin author)
use the unofficial overrides property to override the package dependencies as need, and then use a build tool such as main-bower-files, wiredep
use a custom pluggable resolver (a bit of an overkill just for this)
Install package again with command: bower install --save
I'm new to node and using npm to both do some node, angular and Express tutorials. I have used bower before in a tutorial. I'm pretty sure I have installed it using -g already as when i run the bower -v command I get back 1.3.3 I am to understand that installing it using -g means, Install this globally so that on the next project I don't have to install it again.
1) Is this correct?
2) When I start working with a new project do I have to initialize bower?
3) Is there any reason I should use install bower --save-dev after I have already installed bower (-g)lobally?
4) What exactly does install bower --save-dev do?
I have searched and get nothing on google or stack over flow when I search "--save-dev".
I really want to understand this and if you help me, it will help me understand installing much more than just bower and how to use those installs. Again, I'm new to the command line for this type of development and new to these technologies, but have some basic understanding.
Using the --save and --save-dev flags when installing will add them to the project's package.json. This allows anyone who might develop on or use the project to install the dependencies as needed with a simple npm install command. By contrast, the -g flag is global only to your local machine.