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

Failed to create .yarn-integrity file in a bower project #757

Closed
laubstein opened this issue Oct 11, 2016 · 4 comments
Closed

Failed to create .yarn-integrity file in a bower project #757

laubstein opened this issue Oct 11, 2016 · 4 comments

Comments

@laubstein
Copy link

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

What is the current behavior?
After run yarn in a simple bower project, I receive: error ENOENT: no such file or directory, open '/tmp/b/node_modules/.yarn-integrity' at Error (native)

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

bower init (default options)
bower install --save jquery
rm -fr bower_components
yarn

What is the expected behavior?
bower_components created without error message

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

yarn --version = 0.15.1
node --version = v6.4.0
@tony19
Copy link

tony19 commented Oct 12, 2016

Workaround

Create node_modules/ directory before running yarn.

Bug Research

I think the issue is twofold:

  1. writeIntegrityHash() does not create the intermediate directories in the specified path, and fs.writeFile() throws an error for a path with a missing intermediate directory.
  2. getIntegrityHashLocation() inserts node_modules/ into the first slot of possibleFolders[], but this directory never existed (as this is strictly a Bower project). This function returns the first slot by default if .yarn-integrity was not found in possibleFolders[]. For a Bower project, the first slot should really be bower_components/.

@Th3Mouk
Copy link

Th3Mouk commented Oct 14, 2016

This workaround is ok

@tony19
Copy link

tony19 commented Oct 25, 2016

For some reason, I can't reproduce this error any longer, but I think this workaround might be even better (in that a pre-existing node_modules/ isn't needed):

yarn install --modules-folder bower_components

Let me know if this works for you.

@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 removed the needs triage label Nov 10, 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