-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Installed devDependencies with --prod flag set #3577
Comments
(Edit: brew installed tree and re-ran command to get comparable output) I'm unable to reproduce this on osx sierra, yarn 0.24.4
Is it possible that you had previously added Side note; I'm not sure the
There must be some other factor at play here... |
Thanks for taking a look @rally25rs. I'm doing a little more digging on my end to provide a better minimal test case for reproduction. |
@rally25rs I noticed your repro steps did not match my own. Here's a
|
https://yarnpkg.com/en/docs/migrating-from-npm Pulling doc for reference:
|
And here's a gist containing the |
The crux of this issue seems to be I raised #3473 two weeks ago as I was attempting to update my project README to add a
The intention here is to highlight the lib may be used without installation of any other dependencies, which |
Thanks for the quick follow-up, @rally25rs. Updating title to reflect the true nature of this issue now that it seems we've nailed it and because the related issues are currently closed. |
Tested in 0.24.4 and 0.24.6. Both had the same behavior.
|
Did a quick pass through some of the source and issues and found: Duplicate issues: I gave up after that. Here's a search to turn up the rest. Saw here a duplicate has been closed as a non-issue with justification: #3468 (comment) Using my inbuilt cyclomatic complexity detector (that's a joke) I'd wager the bug somewhere in here: Lines 289 to 300 in 4463175
And these lines stuck me as odd: yarn/scripts/build-dist-debug.sh Lines 20 to 21 in 9931b39
Wasn't able to determine if there was test coverage on the config (moved onto other tasks). |
You know what, I just played with this some more, and realized some interesting behavior... The yarn.lock file still lists the dev deps, as does
So now I'm questioning my above comment where I was thinking that devDependencies were being installed. I was relying on |
Scientific method suggests we shouldn't introduce any variables between steps until a new hypothesis can be drawn. To reproduce the issue grab the Actual: 206 directories, 1909 files |
Seems to be dependent on what specific packages are in your Cut your package.json devDeps down to just this one:
After a
So it doesn't actually install your devDependencies, but some transient deps somehow get included, but not all of them either. I haven't quite nailed down the commonality in the 3 deps above that cause them to get installed. They all seem to come from different places in the dependency graph. For example:
yet, If you look at
|
OK, It looks like this is already fixed in
|
Can we leave this one open until the release is dist tagged this time? EDIT: Furthermore this is a common regression seems like based on the number of related or duplicative issues. Some additional investigation into root case and improved test coverage is advised. Lastly, it would be stellar to update the CLI to use common behaviors such as allowing flags to be ordered before subcommands and to gain more parity with the NPM and Bower CLI for use of things like |
My guess is that this is because we always resolve all modules (including development modules) even when running in production mode, because otherwise the dependency tree could end up very different between production and development modes. We don't actually install dependencies that are not relevant to the current environment (or at least we shouldn't), but we still need to resolve them somehow :) |
As it is fixed in master we plan to release 0.27.0 early next week. |
Still jumping the gun a little IMO. But I'll settle for a promise. |
The 0.27.0 has been released! @JHabdas can you check that it fixes your use case? |
On it |
That's what I wanted to see:
This issue may be closed now (half joking there, half not). By the way, I speculate NPM is about to become a general purpose front-end package manager as a result of the Bower deprecation notice. I hope you guys are able to capitalize on this opportunity quickly by introducing a pattern to define the split. Cheerio! |
Just test it and it seems to work.
|
I am potentially having this issue when using yarn workspaces and local file package references |
This is an extension of #3473, which was closed during issue pruning. This is not the same issue.
Do you want to request a feature or report a bug?
It's a bug.
What is the current behavior?
Installs all package development dependencies when
--prod
flag set.If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Only following output is printed to the output buffer when
tree
is run with-h
flag:Please mention your node.js, yarn and operating system version.
The text was updated successfully, but these errors were encountered: