Installing Node.js - pros/cons of using Brew vs manually managing?

pccjamie picture pccjamie · Apr 15, 2014 · Viewed 11.4k times · Source

So I'm looking for some info on what the pros and cons are of managing a node.js package that has been installed manually vs using homebrew. Aside from the obvious advantages of having brew manage everything for you (as opposed to using nvm to keep node updated), are there any actual problems or potential conflicts to be aware of when managing somethings with brew and others manually? (or via npm, nvm, etc?)

Answer

Peter Lyons picture Peter Lyons · Apr 15, 2014

My situation for application interpreters such as node.js (or python or ruby or etc) is that:

  • I have many projects, sometimes dozens and dozens
  • Each project is either moderately or tightly coupled to a particular interpreter version
    • for example, needs node v0.8.x or v0.10.24
  • Installing these interpreters system-wide encourages coupling across projects, so I upgrade node because project8 is ready to upgrade and project3 breaks.

Given these constraints, I install my interpreters per-project because having stability and decoupling is more important to me than other factors such as reducing disk space requirements.

homebrew is great for project-agnostic tools like ag, git, etc, as well as relatively stable other things like postgresql or mysql or mongodb. But for the actual language runtime, the coupling is too tight so I don't use homebrew for that.

Installing node is just downloading and extracting a tar archive, so honestly you don't need fancy tools. However, I do have a project called wallah that can help with this. You might also look at nvm and envirius