-
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
Different results between Yarn & npm #7098
Comments
No we don't? This in itself is not a reason for something to be described a bug
It seems to me Yarn is correct here - you depend on Npm might link things slightly differently but that hardly matters since the way things are laid out in the |
How can you explain that the code execution result in different dependency being imported? I am trying hard to fix our npm installation and so far yarn is our source of truth. How could it be? |
I can't investigate your code, but it's possible that npm locked your dependencies to a different set from what Yarn did (we have different resolution algorithms with different heuristics, so the end result isn't necessarily the same, while always correct). Maybe one of your dependencies introduced a breaking change without respecting semver, and you got burned by it. Maybe there's also a bug in npm for all I know - I think they have problems with peer dependencies and hoisting, so it might be it. |
Fair enough, what we need is to understand how we can make
What do you mean by
With With
We do not use |
See the problem? 😛 Again, it seems to me that you've hit the problem described here - they even specifically mention |
I see, thanks a lot for the explanation. We prefer to support the official npm package manager for the moment. One question before closing, if |
There are a lot of reasons and you probably can understand why I prefer not to answer it myself. I just want to point out that I find it a bit interesting that we get this question every once in a while, even though noone would ever ask the same thing of say Webpack vs Parcel, React vs Vue, Gatsby vs Next, etc. As open-source maintainers, whether it's the Yarn or npm folks, we all put our efforts into the projects that we like to work with, and that's how it should work. |
I like to work with things that work 🤓 That lead me to a last question, which stopped me using yarn even after tones of reading. How can yarn succeed on long term support? |
When I started working on Yarn (February 2017) we were at roughly 20% market share based on the number of downloads from the npm registry (ie 20% of all the downloads came from Yarn). Shortly after npm's infrastructure change break our stats (August 2018) we were at 48%. Your guess is as good as mine regarding where we are now 🙂 There's a common misconception that Yarn is the outsider. It's too bad we lost access to our stats to disprove it. We've been pinging npm to fix it every now and then, but it's never been their top priority.
Doing what we do best, coming up with new solutions to existing problems. I think we'll eventually have to speak to the Node project to solve this "npm is the only default" thing, it makes little sense when both package managers have roughly the same following. |
Doing
yarn
andnpm install
produce differentnode_modules
(it can be tested on package named react-styleguidist)What is the current behavior?
With yarn,
ls node_modules/react-styleguidist/node_modules/.bin
:With npm,
ls node_modules/react-styleguidist/node_modules/.bin
:acorn -> ../../../acorn/bin/acorn
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
We expect to have the same result between npm and yarn.
Versions
yarn -v 1.13.0
npm -v 6.8.0
Related issues
The text was updated successfully, but these errors were encountered: