Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?)

like image 906
pccjamie Avatar asked Apr 15 '14 19:04

pccjamie


People also ask

Should you use homebrew to install Node?

Use Homebrew to install Node. js on MacOS. Homebrew is a better way to manage various packages on your Mac.

What is the best way to install Nodejs on Mac?

js on Mac is nvm . You can use the install script for nvm installation. Or if you want to install any specific LTS version use below to install that.

Is NVM the best way to install Node?

Note: We do not recommend using nvm to install Node. js for production environments. If you're installing Node. js on your production environment you should consider using your OS's package manager, or your server tooling of choice, to install and lock the environment to a specific version of Node.


1 Answers

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

like image 67
Peter Lyons Avatar answered Oct 26 '22 00:10

Peter Lyons