ipfs-inactive / dev-team-enablement

[ARCHIVED] Dev Team Enablement Working Group
3 stars 1 forks source link

Yarn vs NPM #39

Closed daviddias closed 5 years ago

daviddias commented 6 years ago

During the last js-ipfs Weekly All Hands -- https://github.com/ipfs/js-ipfs/issues/1179#issuecomment-390674555 --, there were a lots of question about Yarn vs NPM (https://youtu.be/CNAPR9HMjR4?t=26m57s).

@VictorBjelkholm @travisperson can you expand on the rationale behind it and if it still holds true with the latest npm vs yarn?

victorb commented 6 years ago

As far as I understand the call, it's less about the CLIs themselves but more regarding lock-files. That would be a more appropriate conversation in ipfs/community. For that conversation, we need to figure out a way of making lock-files work for both npm/yarn and consumers/developers, which right now, is tricky.

Regarding running yarn on CI, it's faster and worked when running multiple instances on the same worker, npm didn't, so we went with yarn there. Situation might be better now (and we're not leveraging the multiple jobs per worker anyways right now) so we can give npm a try. npm still seems to be the de-facto standard for JS so makes sense that we use it as well.

travisperson commented 6 years ago

I out of habit still use yarn pretty extensively except in a few cases where it does not meet feature parody. I originally made the switch a year ago with my team due to lock-file issues. I'm pretty sure most of the grievances no longer exist.

Unless there is a specific reason for the use of yarn for IPFS, I think it's best to keep to npm for simplicity in the community going forward.

victorb commented 6 years ago

Anecdote but since the conversation of npm vs yarn came up again, I started using npm. I did not even manage to install modules for js-ipfs on latest version (6.1.0) with nodejs 9.5.0, while yarn as no issues with it.

So while we can decide as a org to move forward with npm, I cannot myself do this yet as it doesn't work for even the most basic use-case, installing packages.

image

daviddias commented 6 years ago

Try with Node.js 8 and 10, not 9.

victorb commented 6 years ago

@diasdavid pretty sure it's about npm, not node.js. But I tried node.js 8 and 10, with no success. Then I tried npm@6.0.0 and npm@5, same failures. Then I got tired and tried npm@2 instead, and success! Everything worked! So I guess I either have some weird state on my machine, or npm simply does not work well on linux nowadays.

https://gist.github.com/VictorBjelkholm/93a818c4d360022b43bd5b5b55663776

travisperson commented 6 years ago

Interesting. I just ran an install on linux with nodejs 8.11.2, and npm 5.6.0 with no issues.

dryajov commented 6 years ago

I've been using npm exclusively with various node versions (8, 9, 10) as well as npm 5.6 and 6.0 without any issues.