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

install fails if directory has empty file with name "1" #4013

Closed
bestander opened this issue Jul 24, 2017 · 0 comments
Closed

install fails if directory has empty file with name "1" #4013

bestander opened this issue Jul 24, 2017 · 0 comments

Comments

@bestander
Copy link
Member

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

What is the current behavior?

Weird install failure

package.json

{
  "name": "test",
  "dependencies": {
    "glob": "^7.1.1"
  }
}
touch 1
yarn install
yarn install v0.28.1
warning package.json: No license field
warning test: No license field
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error An unexpected error occurred: "ENOTDIR: not a directory, scandir '/Users/bestander/Library/Caches/Yarn/v1/npm-wrappy-0.0.0-a3898aef-4262-4dd5-afa7-204e8e8cb0b2-1500935336291'".
info If you think this is a bug, please open a bug report with the information provided in "/Users/bestander/work/temp/weird/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

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

@BYK BYK self-assigned this Aug 3, 2017
BYK pushed a commit that referenced this issue Aug 3, 2017
**Summary**

Fixes #4013. We were blindly priotizing local files (even if they
are not directories) if there's anything on the file system matching
a pattern for a package. This patch ensures that we only do this if
the pattern starts with `./`, `../`. `/`, `~/` (and their `\` versions
for Windows) and the matched local entity is a directory. The former
part is in line with [NPM specs](https://docs.npmjs.com/files/package.json#local-paths).

**Test plan**

Added a new unit test and modified an incorrect old one. Also manually
verified that the issue described in #4013 does not happen anymore.
@BYK BYK closed this as completed in #4088 Aug 4, 2017
BYK added a commit that referenced this issue Aug 4, 2017
**Summary**

Fixes #4013. We were blindly priotizing local files (even if they
are not directories) if there's anything on the file system matching
a pattern for a package. This patch ensures that we only do this if
the pattern is not a valid semver range and the matched local entity is a directory.
**Test plan**

Added a new unit test and modified an incorrect old one. Also manually
verified that the issue described in #4013 does not happen anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants