Hacker News new | ask | show | jobs
by paulirish 3782 days ago
> At least on OS X, things are a little easier with Homebrew.

Absolutely. I adore Homebrew and it's ecosystem. Cask, in particular, is quite satisfying; gotta love installing a swath of neccessary fonts from the terminal. And, fwiw, the project is about to be on Homebrew, with no tap required: https://github.com/Homebrew/homebrew/pull/49040 Though getting it up was not quite as pain-free than our initial publishes to NPM.

The thing is: Homebrew solves the problem for just a portion of your audience. In diff-so-fancy's case, we've supported Linux and Windows from the get-go, the only hard part is getting it installed. NPM solves that problem really well, and I can't imagine any other installation technique being our recommendation for Windows/Linux going forward.

4 comments

This only makes sense if you believe all Homebrew packages are written in JavaScript... which they aren't. Also I've been using Homebrew for about 4x as long as NPM and I have about 1/10th of the issues, so I'll just stick to the package manager that works.
You can use npm to distribute binaries.
That doesn't mean it's a good idea to.

NPM does a great job of distribiting development dependencies and Node.js applications.

It's not really intended for non-js binary builds and platform-specific dependencies.

You can always use NPM to install directly from specific repo release but you'll still have to have to include a native compile-to-platform step somewhere.

Linux Homebrew[0] can cover it for linux. Just need Windows Homebrew.

[0]: https://github.com/Linuxbrew/linuxbrew

Wait, what problem is this solving?

  > Can install software to a home directory and so does not require sudo
  > Install software not packaged by the native distribution
  > Install up-to-date versions of software when the native distribution is old
  > Use the same package manager to manage both your Mac and Linux machines
From the "Features" section of the Github.

It could also likely be used so make a "safe" Linux distro, where the base system is mounted read only, with a writable home partition.

> Cask

In my experience, cask is too fragile for its original use of installing binaries. Issues include

* applications expecting to be installed to /Applications

* applications with weird installation requirements/dependencies

* self-updater conflicting with cask's installation settings

* problems with detecting an installation (and uninstalling it) because the updated version's recipe installs differently or something.

For these reasons I now prefer to install applications by their official/expected/supported installation method.

On the other hand, I find brew very useful.

Using npm to distribute a shell script, seriously? That's not such a good idea. I think what you want is something like the Autotools so your software may be installed with the standard './configure && make && make install'. This way, you make it easy for upstream distributions to package your software.
Wouldn't that have issues with Windows? I'm not a huge fan of NPM but it works really well when you want to be cross platform.
npm only works well for Windows if the program you're distributing is itself in JavaScript using Node. If you're using npm to distribute a shell script, then you still need a Unixy environment for Windows like Cygwin or MSYS, and in that case, autotools is probably no worse.