Yarn: Deployment/Installation

Created on 5 Sep 2016  ยท  14Comments  ยท  Source: yarnpkg/yarn

Possible targets:

  • Multiplatform

    • [x] wget | ssh

    • [ ] npm

    • [ ] rubygems

    • [ ] pip

    • [ ] pkgsrc/pkgin

  • BSD

    • [ ] ports

    • [ ] pkgng

  • Linux

    • [ ] Portage

    • [ ] ZYpp

    • [x] Ubuntu/Debian PPA (@Daniel15) #414

    • [x] deb @Daniel15 #414

    • [ ] rpm

  • OSX

    • [ ] Homebrew (@kittens) #418

    • [ ] MacPorts

    • [ ] pkg (@thejameskyle)

  • Windows

    • [x] msi @Daniel15 #438

    • [x] Chocolatey @Daniel15 depends on #438

    • [ ] Scoop

All 14 comments

cc @bestander

I could help with that

On Monday, 5 September 2016, Sebastian McKenzie [email protected]
wrote:

cc @bestander https://github.com/bestander

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/facebook/fbkpm/issues/275#issuecomment-244740949, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACBdWG-cBIF4G1mwYg209KEEgdsKUJPHks5qnBG4gaJpZM4J1BfV
.

Was sidetracked from this to sort out internal FB integration issues.
Probably won't be able to touch this for a week

Ok, we definitely need to focus on this next week. I think the best approach is to pick the most common ones per platform and provide fallbacks, like:

  • macos: homebrew
  • linux (ubuntu): apt
  • windows: ?
  • multiplatform: npm, wget

Ideally deploying Yarn to all of these systems should be easy, otherwise it'll be a hassle to keep them updated.

what do you think about that?

cc @Daniel15

Here's what I wrote in #385 before I realised that an issue already existed for this ๐Ÿ˜›


Ubuntu is by far the most popular Linux distribution, so I think a fairly large portion of Yarn users will be using it in their development environment (often via Docker or Vagrant). We should build Debian/Ubuntu packages as part of the build, to allow users to simply do apt-get install yarn to install it, and their regular system updates (apt-get update && apt-get upgrade ) will keep it up-to-date.

We should also consider a Chocolatey package for Windows users, but that can go in a separate task.

Examples of what other projects do:

Advantages of using the system's native package manager rather than something like npm install -g yarn:

  • Upgrades are handled the same way as all other software on your system (apt-get upgrade). It's not a special snowflake.
  • All the security problems with npm (eg. packages not being signed) make it less than ideal for anything installed system wide. apt-get gives you proper GPG signature verification.
  • Using npm means you're tightly-coupled to npm. If you later want to have a better installation solution, you need to have this awkward transition period where you try to get users to switch to the newer installation method.
  • The setup instructions need the whole weird "_install Node.js first, then ensure npm is up-to-date, then install Yarn_" thing. That'd be like telling people to manually install their npm dependencies ๐Ÿ˜† . With a proper package management system, the Yarn package would simply have a dependency on the Node.js package, and "apt-get install yarn" would install both.

If we want to appeal to people that have limited Node.js experience, we shouldn't make any assumptions that they know anything about the Node.js ecosystem or what "npm" even is.


Ideally deploying Yarn to all of these systems should be easy, otherwise it'll be a hassle to keep them updated.

It should all be automatable I think. The HHVM team have a cronjob for nightly builds, we could do something similar for unstable/testing versions. Building after every single Git commit is probably a bit excessive ๐Ÿ˜› For stable releases we could have a script that packages it in all the formats we want to use.

windows: ?

Chocolatey is nice and there's a client built-in to Windows (via OneGet), it just needs to be enabled

I might take a look at this on the weekend, at least for the environments I'm familiar with (Windows and Debian/Ubuntu).

I was thinking to mention yarn in the react native docs and the fewer recommended installation options, the simpler it will be to write docs and error messages relating to installing node modules. Based on our experience with other dependencies (Node, Watchman) it's easiest if the installation method consistently requires/doesn't require sudo and tells the user when there's a new version without needing to manually check (a lot of people don't run brew upgrade often).

tells the user when there's a new version without needing to manually check

This is one thing Ubuntu seems to do - It shows the number of packages with updates when you log in (at least when you log in via SSH). I use Debian on my personal servers and haven't seen it on there, so it seems specific to Ubuntu. I just run apt-get update && apt-get dist-upgrade once a week or so to get the latest Nginx, PHP, Node.js, etc.) I think anyone that uses Ubuntu would be familiar with apt-get :)

This is one of the advantages of using the native package management system on the user's OS. As long as they keep their OS up-to-date, everything is fine and Yarn will just be updated alongside everything else on the system.

I guess Yarn could show a version notice at startup, but it'd need to check the right place for the version number.

Besides that we have self-update feature in yarn that does not need
permissions.

On Wednesday, 21 September 2016, Daniel Lo Nigro [email protected]
wrote:

tells the user when there's a new version without needing to manually check

This is one thing Ubuntu seems to do - It shows the number of packages
with updates when you log in (at least when you log in via SSH). I use
Debian on my personal servers and haven't seen it on there, so it seems
specific to Ubuntu. I think anyone that uses Ubuntu would be familiar with
apt-get :)

โ€”
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/yarnpkg/yarn/issues/275#issuecomment-248518478, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACBdWHgrnpdpE9-qWKXLW_TCwjvUBdV_ks5qsMaVgaJpZM4J1BfV
.

Work-in-progress PR for Debian packaging: #414

I'll try building an installer for macOS using https://github.com/LinusU/node-appdmg

Also, I don't think there's any need to put it on MacPorts. Everyone has moved to Homebrew at this point.

For "Multiplatform", I think the existing tarball is sufficient as you can just download and extract it, eg:

cd /opt/
wget https://github.com/yarnpkg/yarn/releases/download/v0.13.5/kpm-v0.13.5.tar.gz
tar zvxf kpm-v0.13.5.tar.gz

Ideally coupled with https://github.com/yarnpkg/website/issues/13 to have a nice download URL for the latest release (eg. https://yarnpkg.com/latest.tgz)

Going to close this. We have a bunch of awesome installers thanks to @Daniel15. I've merged #568 which adds a generic tarball install script that we'll recommend for OSX users until we have a Homebrew formula. Thanks everyone! We can work out automated releases etc post-open source.

Was this page helpful?
0 / 5 - 0 ratings