(I do think “NPM publish” for publishing new packages does work much better than Yarn at the moment).
Yarn actually had the same problem for a while; the first time I tried Yarn, there were no less than 3 issues that prevented me from actually using it (and that is why I stayed on NPM 3 for a while, and eventually gave NPM 5 a shot). NPM is now at 5.2.1 and some basic things still prevent me from using it (especially the lockfile changing between installs of the same packages and between devs on the team).
At the time this felt like the right move for the team as a balance between new features (lock file!
) and not having to learn anything new (everyone already knows how to NPM).
This can be very frustrating because developers will need to know if they should or shouldn’t commit these changes. For example, if an OSX dev commits the lockfile the “fsevents” entry, the next time the OSX dev “npm install”s they will get the latest “fsevents” according to the semver range in package.json, potentially a different version than what they used to have in their lockfile before the Windows dev deleted it.
This basically breaks the entire point of the lockfile!
Disclosure: I’ve been contributing to the Yarn open-source project for a few months and have several accepted PRs. It honestly would not have bothered me if NPM5 was so awesome that everyone abandoned Yarn completely.
I’d rather just use the best tool for the job than “fanboy” a specific one.
This is to provide the ability of performing a true deterministic install.
Since starting down that path, I feel like something in NPM5 has fought me the entire way…
In the end, I’m now regretting that choice and thinking I should have just introduced Yarn sooner. NPM5 brought a huge improvement to speed (about 2x as fast) over NPM3 which was horribly slow.
I really tried to not be a “Yarn fanboy” and give NPM5 a shot (several, actually, and months to resolve the initial issues) but it seemed that every time I moved forward, I just hit another issue that prevented me from using it cleanly.
I could make the above list of NPM shortcomings pretty easily, but don’t have may things that Yarn can’t do that NPM can.