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 add jest@test fails if test is a folder #4251

Closed
cpojer opened this issue Aug 24, 2017 · 1 comment
Closed

yarn add jest@test fails if test is a folder #4251

cpojer opened this issue Aug 24, 2017 · 1 comment
Assignees

Comments

@cpojer
Copy link
Contributor

cpojer commented Aug 24, 2017

Repro:

mkdir test
yarn add jest@test
# node_modules/jest is ../test
@BYK BYK self-assigned this Aug 25, 2017
@BYK
Copy link
Member

BYK commented Aug 25, 2017

This is a different manifestation of #4013.

BYK added a commit that referenced this issue Aug 25, 2017
**Summary**

Fixes #4251. Follow up to #4088. Instead of just checking whether the
target is a valid directory, we now check if it contains a
`package.json` file too. This is still different from `npm`'s behavior.
Apparently, `npm` fetches the package info upfront to favor dist-tags
over directories but this comes at a distinct performance penalty and
makes static, deterministic resolution impossible so we are now
deprecating the implicit `file:` protocol in patterns. After a certain
point, we'll remove this code and will require everyone to use `file:`
or at least one of the following path identifiers: `./`, `../`. `/`.

**Test plan**

Updated the existing test for warning check and added a new test for
invalid directories.
@BYK BYK closed this as completed in #4257 Aug 25, 2017
BYK added a commit that referenced this issue Aug 25, 2017
…4257)

**Summary**

Fixes #4251. Follow up to #4088. Instead of just checking whether the
target is a valid directory, we now check if it contains a
`package.json` file too. This is still different from `npm`'s behavior.
Apparently, `npm` fetches the package info upfront to favor dist-tags
over directories but this comes at a distinct performance penalty and
makes static, deterministic resolution impossible so we are now
deprecating the implicit `file:` protocol in patterns. After a certain
point, we'll remove this code and will require everyone to use `file:`
or at least one of the following path identifiers: `./`, `../`. `/`.

**Test plan**

Updated the existing test for warning check and added a new test for
invalid directories.
joaolucasl pushed a commit to joaolucasl/yarn that referenced this issue Oct 27, 2017
…arnpkg#4257)

**Summary**

Fixes yarnpkg#4251. Follow up to yarnpkg#4088. Instead of just checking whether the
target is a valid directory, we now check if it contains a
`package.json` file too. This is still different from `npm`'s behavior.
Apparently, `npm` fetches the package info upfront to favor dist-tags
over directories but this comes at a distinct performance penalty and
makes static, deterministic resolution impossible so we are now
deprecating the implicit `file:` protocol in patterns. After a certain
point, we'll remove this code and will require everyone to use `file:`
or at least one of the following path identifiers: `./`, `../`. `/`.

**Test plan**

Updated the existing test for warning check and added a new test for
invalid directories.
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

2 participants