Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarn recursively deletes all bower.json files #730

Closed
OverZealous opened this issue Oct 11, 2016 · 5 comments
Closed

Yarn recursively deletes all bower.json files #730

OverZealous opened this issue Oct 11, 2016 · 5 comments

Comments

@OverZealous
Copy link

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

What is the current behavior?
Running yarn on an existing project deleted several bower.json and .bower.json files, which weren't even in the root of the current project.

These were files that existed within the test directory, used in unit tests. However, I think it's unacceptable that yarn removes any files without warning or even a message on the command line.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Clone this repo: https://github.com/OverZealous/cdnizer
  2. Run yarn at the root
  3. See changes:
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    new file:   yarn.lock

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    deleted:    test/bower/components/angular/bower.json
    deleted:    test/bower/components/no-bower-version/.bower.json
    deleted:    test/bower/components/no-bower-version/bower.json
    deleted:    test/bower/components/no-dot-bower-version/bower.json

What is the expected behavior?

  1. Existing bower.json and .bower.json files should be left as-is.
  2. A warning should be given any time a file is to be removed, especially if it's not within the node_modules (or possibly bower_components) directory.

Please mention your node.js, yarn and operating system version.

  • node -v: v5.12.0
  • yarn --version: 0.15.1
  • OS: Mac OS X 10.11.6
@oskarhane
Copy link

oskarhane commented Oct 12, 2016

Same here, I was really surprised when yarn deleted 2220 files (all bower dependencies in a dir named components).

@Ben-Gee
Copy link

Ben-Gee commented Oct 12, 2016

Same here,
yarn simply removes all files in my bower_components directory.

@oskarhane
Copy link

The workaround that fixed my issue (I think I had that issue because I have package.json and bower.json in the same directory) was this:

yarn -> mv package.json p.json -> yarn -> mv p.json package.json

The first yarn installs npm dependencies and removes bower dependencies and the second one installs bower dependencies.

@OverZealous
Copy link
Author

This is a different problem than removing files within bower_components, there's a separate issue reported for that already.

This issue is that it's removing the bower.json files themselves, and they weren't even in the same directory.

While I agree that yarn shouldn't be touching Bower setups, we should make sure each issue stays focused.

@sebmck
Copy link
Contributor

sebmck commented Oct 26, 2016

We've removed support for Bower, see #1441.

@sebmck sebmck closed this as completed Oct 26, 2016
@wyze wyze added invalid and removed needs triage labels Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants