Yarn: bower components not installed automatically from bower.json?

Created on 12 Oct 2016  路  6Comments  路  Source: yarnpkg/yarn

Do you want to request a _feature_ or report a _bug_?
Bug

What is the current behavior?
I have a bower.json in the root directory of a project alongside package.json.

The bower.json contents are:

{
  "name": "my-project-name",
  "version": "0.0.0",
  "appPath": "src",
  "resolutions": {
    "angular": "^1.4.8"
  },
  "dependencies": {
    "angular-material": "1.0.3-master-0918596",
    "angular-ui-map": "~0.5.0",
    "angular-tour-no-jQuery": "~0.2.6",
    "ngclipboard": "^1.1.0"
  }
}

Should Bower support work automatically?

(The package.json has a postinstall script that runs bower install. I've seen pre/post-install hooks don't currently get run as per #853, but yarn says it supports bower itself so...)

If the current behavior is a bug, please provide the steps to reproduce.
rm -rf node_modules bower_components

run yarn.

node_modules are populated but bower_components are not.

What is the expected behavior?
yarn reads the bower.json and populates the bower_components folder with bower dependencies.

yarn should also track the bower components in its yarn.lock file (related: #846)

Please mention your node.js, yarn and operating system version.
node 6.2.2
yarn 0.15.1 (installed globally with npm)
bower 1.7.9 (installed globally with npm)
OSX El Capitan

Most helpful comment

Further on this:

I have a setup with node_modules and bower_components. Upon deleting the node_modules directory (but leaving bower_components) and running yarn, I get an empty bower_components directory.

All 6 comments

Note here: if yarn were to process bower.json, it would be very important for us if it would also honor the configuration file .bowerrc, at least the "directory" entry there.

Further on this:

I have a setup with node_modules and bower_components. Upon deleting the node_modules directory (but leaving bower_components) and running yarn, I get an empty bower_components directory.

@sb8244 you may want #616 for the nixing of bower_components contents

This is a duplicate of #665

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" }

Bower support has been dropped in #1441.

Was this page helpful?
0 / 5 - 0 ratings