4 ms·
> `yarn` is a generally superior alternative to `npm`. I’m about 18 months out from last using it, but people were saying this then and it was, in fact, full o
by shantly 7y ago
> `yarn` is a generally superior alternative to `npm`.
I’m about 18 months out from last using it, but people were saying this then and it was, in fact, full of bugs and missing features. The company I was at kept starting projects with it because it was trendy, then switching to NPM when we tried to use a feature yarn didn’t have or lost an hour debugging some problem that turned out to be yarn-induced breakage. This was the consistent experience of about a dozen developers across several projects, most of whom were very enthusiastic about yarn, at first.
Maybe it’s much better now but, again, people have been saying this since it first came out and if it’s true, it’s a recent development.
- ivankolev 7y agoI have the opposite experience, for our project once we moved to yarn it just works, we have not touched the config in close to a year.
- shantly 7y agoI recall running into: - Messing up certain cases of dependency resolution such that you'd get a different version than NPM would give you. - Something involving not checking paths they should have been, that caused brokenness. - Local package problems of several sorts—really any 1%-of-users-or-lower use case, and I'd guess "just fetch some packages from the NPM servers" is the sole use case over 1%, seemed fairly likely to have problems. - All of the above and more sometimes causing a dependency that worked under npm to fail with misleading error messages due to bad interactions between that package and yarn. There were more but I don't remember all of them. My impression was that they implemented half the features of npm, did way fewer correctness and safety checks, crowed about how fast they were, and everyone crowned it as a superior drop-in replacement for npm literally years before that would be justified. Mind I have no love for npm and don't much care what the command I run is called or who made it, I just repeatedly saw projects start on yarn then hit a silly problem the simplest fix for which was "use npm", while people were running around shit-talking npm and acting like yarn was some kind of miracle. [EDIT] our projects were node, React, and React Native. I'd definitely believe it's possible use Yarn and never hit this if you don't happen to use a package that's broken in it and has only been tested under npm, or happen to step on one of the landmines, and maybe it actually is totally fine now, I just know people were claiming it already was and sticking their fingers in their ears when you told them otherwise back when it absolutely was not a suitable npm replacement yet.
- leshow 7y ago> - Messing up certain cases of dependency resolution such that you'd get a different version than NPM would give you. NPM can mess up it's own dependencies, or give you different dependencies on different machines. It's algorithm is (was?) non-deterministic. > - Local package problems of several sorts I use yarn with lerna to keep a monorepo of local packages together, it works pretty well. At the time, npm didn't. > - All of the above and more sometimes causing a dependency that worked under npm to fail with misleading error messages due to bad interactions between that package and yarn. Never ran into anything like this. Show me a package that doesn't work with yarn Yarn gave npm some much needed competition and made npm improve a bit. Before yarn, npm didn't even have lockfiles. Having both is good, but I've just had less issues with yarn overall.
- shantly 7y ago> Never ran into anything like this. Show me a package that doesn't work with yarn Been too long, don't remember. Happened more than once. Options were "debug package under yarn, and assuming there's a way to fix it without modifying yarn itself, submit PR to package's repo" or "just use npm". Naïve search for 'is:issue is:open "npm works"' over yarn's ~2,000 open issues reveals some packages that don't work with it, pretty quickly. I'm sure npm has bugs too but we consistently and reliably ran into yarn problems that could be fixed immediately by switching to npm, on several projects. A browse through their issues more generally reveal tons and tons of broken features and edge cases, still, looks like, which is how it was back when I was using it, too. If it's working for folks that's fine, but I think it's still a bad idea to give (especially) newbies the impression yarn's clearly the best choice.