3 ms·
node releases should ship with yarn instead of npm. Yarn is better all around - faster, deterministic, local caching, offline mode, better licensing terms.
by terink 10y ago
node releases should ship with yarn instead of npm. Yarn is better all around - faster, deterministic, local caching, offline mode, better licensing terms.
- mattnewton 10y agoNot everyone is down to switch such a core piece of the infrastructure at the first sign of new and shiny. I think yarn will succeed, but so did lots of people about bower, ied, duo, etc. Give it a moment to settle. The path forward might even be a merger instead of replacement.
- terink 10y agonode developers have overwhelmingly indicated that they want to switch to yarn and are willing to work through the short term problems until it becomes stable. npm wouldn't be a suitable caretaker for yarn.
- franciscop 10y agoI am sorry, but what? What is your source? From a new account[1] with only 3 comments overwhelmingly favoring yarn over npm it's difficult to trust this as it just seems like SPAM. I have been developing in Node over 3 years and trying new things constantly and no, I'm not really excited about yarn. Nor many Node developers I know. [1] https://news.ycombinator.com/threads?id=terink https://news.ycombinator.com/threads?id=terink
- terink 10y agoMost devs on Github disagree with you: https://github.com/yarnpkg/yarn https://github.com/yarnpkg/yarn - 17,271 stars https://github.com/npm/npm https://github.com/npm/npm - 10,807 stars
- franciscop 10y agoAh I see, Github stars. I am not sure they are a good indication though; many people (HN effect?) star something new and fancy when it comes out, while I think NPM can be considered to have "grown" organically with Node.js; which in my experience doesn't attract as many stars at all. When NPM came out the Node community was still in its infancy, with not so many people in the ecosystem. I haven't even starred NPM while I almost starred Yarn the other day.
- deleted 10y ago[deleted]
- alessioalex 10y agoNot unless you want a lot of people upset that their dependencies aren't installing: "Myles Borins (@thealphanerd) recently ran citgm with yarn, and shared the results. It was 25 minutes faster than npm, but 20 modules failed to install." ( https://nodesource.com/blog/the-definitive-guide-to-the-first-three-days-of-yarn-and-npm/ https://nodesource.com/blog/the-definitive-guide-to-the-firs... )
- TheRealPomax 10y agoOnly "in additional to npm", and then really only once yarn is at parity. Right now yarn still has issues installing certain packages, and there is no yarn equivalent to "npm run ..." which is a pretty significant hold-up (projects that rely on npm scripts rather than make files or some other OS-encumbered approach cannot switch over at the moment). It's in the works and slated for a later release, but makes it such that yarn is not a universally viable replacement for npm yet.
- fzzzy 10y agoHow is npm run not os encumbered? It just calls out to the shell. Does it ship with a consistent shell on every platform and use that?
- bsharper 10y agoI just use JS scripts, because if node is not installed you aren't getting very far anyway. Actions like "copy this file", "clear this subdirectory", and "pull these files over the network" are easy to write synchronously in node, are there are modules for things that aren't. For more complex actions, there are modules like env-cmd or cross-env for setting environmental variables on different platforms. If you had something really complex, you could check os.platform() and then call scripts written for each OS. But you're right, you can't write a .sh shell script and expect it to magically work on Windows.
- steveklabnik 10y ago> there is no yarn equivalent to "npm run ..." https://yarnpkg.com/en/docs/cli/run https://yarnpkg.com/en/docs/cli/run ? (I am not primarily a node dev, so I might be missing some nuance here.)
- jkrems 10y agoWell, maybe not before `yarn` actually installs the dependencies of all projects. It still has bugs where it doesn't install "random" transitive dependencies when using `yarn --prod`. Seems premature to make it part of node.
- steveklabnik 10y agohttps://github.com/nodejs/node/issues/9161 https://github.com/nodejs/node/issues/9161 And more specifically, https://github.com/nodejs/node/issues/9161#issuecomment-254531089 https://github.com/nodejs/node/issues/9161#issuecomment-2545...
- terink 10y agohttps://github.com/nodejs/node/issues/9161#issuecomment-254876761 https://github.com/nodejs/node/issues/9161#issuecomment-2548...
- steveklabnik 10y agoI'm not saying this shouldn't be done; I personally will be using yarn for all my future work. It might be a bit early, but regardless, the comment I linked to is about the process that has to happen for that kind of change to be seriously considered.