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.
You can also create a bower. json file and define multiple packages name with or without version. Navigate to your project folder directory and run the command “bower install”. It will download and install all the packages in your bower_components folder.
To add a new Bower package to your project you use the install command. This should be passed the name of the package you wish to install. As well as using the package name, you can also install a package by specifying one of the following: A Git endpoint such as git://github.com/components/jquery.git.
Yarn can consume the same package. json format as npm, and can install any package from the npm registry. This will lay out your node_modules folder using Yarn's resolution algorithm that is compatible with the node.
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"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With