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

Look for yarn.lock in parent directories #3432

Closed
k1sul1 opened this issue May 17, 2017 · 2 comments
Closed

Look for yarn.lock in parent directories #3432

k1sul1 opened this issue May 17, 2017 · 2 comments

Comments

@k1sul1
Copy link

k1sul1 commented May 17, 2017

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

What is the current behavior?
When I run yarn add [package] while editing JS files inside app/js, I get the following output:

:!yarn add cookies-js # running from Vim

yarn add v0.24.4
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
└─ cookies-js@1.2.3
Done in 1.06s.

However, there already is a package.json, yarn.lock and node_modules in the project, just located in /.

What is the expected behavior?
Check if project already has a lockfile, and if it does, add the new dependency to that existing lockfile instead of generating a new lockfile and dependencies to the wrong directory.

package.json could have a "root" field similar to EditorConfig.

Please mention your node.js, yarn and operating system version.
Node: 7.7.2
Yarn: 0.24.4
OS: macOS Sierra 10.12.4

@bestander
Copy link
Member

Yeah, I think Yarn should look for the closest package.json in that case.
Anyone wants to send a PR?

@BYK
Copy link
Member

BYK commented Jul 10, 2017

I think this is very similar to #2709 so shall we merge them?

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