Installing node via homebrew vs package

homebrewpkg

I i initially installed node via the package download at https://nodejs.org/en/.a
This has served me well as I have built numerous projects. However recently I have been reading a tutorial that instructs me to install node via "brew install node"

Do I really need to? Is this considered a separate installation of node? does it serve a different purpose than the one I installed via a package?

Best Answer

For just running javascript you are just using node and npm etc. It does not matter how you installed them.

They would be separate installs of node and which one you get depends on your PATH environment variable.

The tutorial justs gives Homebrew as a different installation probably because the user manages other packages (e.g. git) by Homebrew and it is easier to use one package manager rather than go for a separate different install for each package.