Hey @elopio, I’ve got the
node snap publishing and was planning on asking for aliasing for both
yarn top-level executables from it too. I’ve only now seen that you’re already publishing one but would consider giving this up to allow for an alias instead?
See source @
https://github.com/nodesource/distributions/tree/master/snap — we’re currently doing ‘edge’ but will also be doing release versions for all active release lines. You can see in there that we have Yarn built into the process so
node.yarn is already available and ready to alias. Each new release will get the latest Yarn release shipped in it and we’ll be able to coordinate with the Yarn team to ensure appropriate compatibility where necessary similar to what we do currently with npm as it’s shipped in the Node source (although there are a lot fewer compatibility problems between Node and Yarn as there are between Node and npm).
I’ve been speaking to the Yarn team about this as well and the reasons that we think that both npm and Yarn should come out of the same snap relate to the difference between the version of Node that is used to run npm/Yarn compared to the version of Node that is used to execute that same application. When you
install with both Yarn and npm, they use the current Node version to determine how to assemble the packages. One problem area is the compilation of C/C++ add-ons. It has to download and compile against the correct set of headers and produce an ABI-compatible binary. Currently Node 4, 6, 8, 9 + have compatible ABIs and API’s within the major-version, but break across these release lines so add-ons have to be recompiled. In addition, there are a lot of
postinstall scripts across Node packages that both npm & Yarn will execute as part of installation and a lot of these also rely on the Node version to get a particular job done. Most common of these is to download pre-compiled add-ons that match the correct ABI for the current version of Node.
Hence the dilemma, since we’re unable to pin the version of Node shipped in the
yarn snap to the version of Node shipped in a
node snap that a user might use in combination. The ideal is to ship everything in one and expose it all.
FYI also we are also making plans to ship Yarn in our Linux distribution packages (
https://github.com/nodesource/distributions, the most popular source of Node on Linux aside from native distro repositories) along with npm, so this would be a similar move.