Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to install Node JS on OS X #3969

Closed
surfeatsleep opened this issue Nov 22, 2015 · 5 comments
Closed

Best way to install Node JS on OS X #3969

surfeatsleep opened this issue Nov 22, 2015 · 5 comments
Labels
macos Issues and PRs related to the macOS platform / OSX. question Issues that look for answers.

Comments

@surfeatsleep
Copy link

While the installer available at https://nodejs.org/en/ seems logical to pick, there are numerous blog posts, tutorials, stackoverflow questions, etc. that point to and even highly recommend alternatives.

All of these different recommendations make installing Node JS on OS X a bit confusing.

My question is:
regarding simplicity of installing, updating and uninstalling as well as being safe to use (even for beginners), which of the following is the best way to install Node and why:

  • use the installer from https://nodejs.org/en/
  • homebrew
  • nvm
  • using homebrew to install nvm and than using nvm to install Node (this seems to be the top recommended alternative to the installer)
  • any other way

Some of the reasons why to choose each of the methods:

Use installer
Easiest to install.
Although it seems to be suggested as the best way, since it is on the Node JS homepage, it can be difficult to uninstall, requires adding the path to the node executable to your system $PATH and also affects admin-only system folders.

Homebrew
Easy to uninstall and update, does not require sudo for installing node packages globally.
However it can be a bit buggy at times, needing for workarounds to make it work correctly.

nvm
Easy to uninstall and update, allows multiple versions.
This seems to be quite a good alternative, yet might seem a bit too much if you only need the latest version.

Homebrew to install nvm, nvm to install node
Benefits of easier updating nvm (along with other software used) while getting the flexibility of nvm to work with node, also nvm supposedly installs Node JS in a better way than homebrew directly.
The negative is you install two things simply to install and manage the third.

Any other way
more customisation?
Not sure about the benefits or issues with other alternatives

@mscdex mscdex added question Issues that look for answers. macos Issues and PRs related to the macOS platform / OSX. labels Nov 22, 2015
@tflanagan
Copy link
Contributor

On my gf's Mac, I build it from source every time. It's certianly not the fastest, but you know what you're getting, customized as needed, and it's pretty easy.

@fl0w
Copy link

fl0w commented Nov 23, 2015

Not once did a pure nvm install not work for me on a Mac. I've never done it trough brew, have no idea why one might want to.

@surfeatsleep
Copy link
Author

Thank you for your replies, however I would appreciate if you could elaborate specifically why a certain way is preferred keeping in mind the following: simplicity of installing, updating and uninstalling as well as being safe to use.

I have updated the original question to add some often found arguments for why and why not to use each method.

Personally I would use the installer, but due to the issues mentioned above I am leaning toward homebrew to install nvm, nvm to install node. I'd love to hear some more comments on each method though.

@fl0w
Copy link

fl0w commented Nov 23, 2015

  • Juggling versions is a breeze nvm use 4.2.2, nvm install 5.1.0. It just prepends your PATH.
  • nvm does not require node installed (as for example n does)
  • nvm puts versions into your home directory at ~/.nvm/version

I have no idea why brew should be used because it adds nothing but another layer (to my knowledge). Historically I understand there has been some issues during installation on OS X where users had to sudo each nvm command, and as brew changes ownership of some directories it could have been a lazy fix.

@cjihrig
Copy link
Contributor

cjihrig commented Nov 23, 2015

Can you please move this issue to https://github.com/nodejs/help, which is meant for more general questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macos Issues and PRs related to the macOS platform / OSX. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

5 participants