Yarn install removes everything from bower_components directory #616

Open
skuridin opened this Issue Oct 11, 2016 · 8 comments

Projects

None yet

5 participants

@skuridin
skuridin commented Oct 11, 2016 edited

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?
Removes everything from bower_components directory

If the current behavior is a bug, please provide the steps to reproduce.
In a project, that uses both npm and bower, run yarn

What is the expected behavior?
Install missed modules to node_modules and do nothing with bower_components

Please mention your node.js, yarn and operating system version.
macOS 10.12, node 6.6.0, npm 3.10.3, yarn 0.15.1

@kittens
Yarn member

Yarn is actually a drop in replacement for bother Bower and npm. Are we correctly populating bower_components? Can you check node_modules to see if we're accidentally putting them in there instead?

@skuridin

Can you check node_modules to see if we're accidentally putting them in there instead?

Couldn't find them in node_modules.

git status after executing yarn (it removes event .gitignore):

    deleted:    bower_components/.gitignore
    deleted:    bower_components/jquery-ujs/.bower.json
    deleted:    bower_components/jquery-ujs/CHANGELOG.md
    deleted:    bower_components/jquery-ujs/MIT-LICENSE.txt
    deleted:    bower_components/jquery-ujs/README.md
    deleted:    bower_components/jquery-ujs/bower.json
    deleted:    bower_components/jquery-ujs/src/rails.js
    deleted:    bower_components/jquery.payment/.bower.json
    deleted:    bower_components/jquery.payment/.gitignore
    deleted:    bower_components/jquery.payment/.travis.yml
    deleted:    bower_components/jquery.payment/Cakefile
    deleted:    bower_components/jquery.payment/LICENSE
    deleted:    bower_components/jquery.payment/README.md
    deleted:    bower_components/jquery.payment/bower.json
    deleted:    bower_components/jquery.payment/example/index.html
    deleted:    bower_components/jquery.payment/lib/jquery.payment.js
    deleted:    bower_components/jquery.payment/package.json
    deleted:    bower_components/jquery.payment/payment.jquery.json
    deleted:    bower_components/jquery.payment/src/jquery.payment.coffee
    deleted:    bower_components/jquery.payment/test/index.coffee
@jerguslejko

@skuridin do they appear in the listing when you run yarn ls?

@nathanpalmer

I'm running into the same issue. Once I run yarn and it installs or changes dependencies then bower_components is completely empty.

Looks like they are in node_modules instead.

image

After I run bower install again I get the dependency in bower_components (which is where ember-cli is looking for it.)

image

@RustyToms
RustyToms commented Oct 11, 2016 edited

Same thing here, it appears that bower_components is completely emptied out. I see some of the files in the node_modules folder, but not the majority of them, matching what I see from yarn ls, I think it might be coincidence that some packages match? Running v0.15.1 on a mac.

If yarn interacts with bower, could that be in the documentation somewhere? I can't even find the word "bower" in the docs. And it only shows up in any description in the repo here

@skuridin

@skuridin do they appear in the listing when you run yarn ls?

nope

@RustyToms

I made a very simple repo to demonstrate this issue with a single bower.json and a single package.json dependency: https://github.com/RustyToms/yarn-issue-616

@RustyToms

What seems to be happening here is bower is being added as a registry. All the folders in the registries, including bower_components are being set as possibleExtraneous. Then, if those files weren't included in the files that yarn is building, they are deemed to be actually extraneous and are deleted.

The main problem seems to be that bower.json dependencies don't seem to be properly loaded into the set of dependencies that yarn is collecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment