-
Notifications
You must be signed in to change notification settings - Fork 290
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 #35
Comments
This is a matter of opinion and I suspect opinions vary pretty widely on this. I use nvm (without homebrew) and it works very well for me. I'm not sure it would be good for a server, but for a development environment where I want node installed specifically for me and not for the system and I want to be able to change to different versions easily, it's been great. |
I personally install node from the pkg downloaded from nodejs.org and then |
How about the uninstall process? |
Best way to uninstall is going to depend on how it was initially installed. |
I used the node-v4.2.2.pkg MacOSX Installer... but there is not uninstall tool. |
I also use a mac, OSX 10.10, I have node v0.10.35. I would like to upgrade and it seems that the easiest way would be to just install the latest stable version over my old installation. Is this correct and does it work? I have no problem using macports to manage versions of node--or any other stable node managers--but I would like the latest official version as a global installation. Does this make sense? |
I also installed v0.10.35 globally with a binary from nodejs.org. I'm also curious to know how I would uninstall if I run into trouble installing a new version over my old version (using official binary). |
The files are installed to |
Thanks @evanlucas. Good to know. I'll try it. I'm trying to get busy with some code here!!! |
Thank you! |
@evanlucas can you give me some examples of issues where I should try and fix by removing the The reason I ask is because I just tried installing learnyounode and it gave me an EACCES error. I know this may not be the correct place to ask, but is this normal? I plan on just using sudo in this case. If you think I should try erasing |
@johan718 no I wouldn't do it unless you are unable to run npm at all. There have been some cases with v5 on OS X where the npm installation got botched. An EACCES error means that you probably need to run npm with For posterity, the issue related to the botched install is nodejs/node#3606 |
@evanlucas thanks a lot! Got it. My |
I believe that is what it defaults to (someone please correct me if I'm wrong). Some developers that use OS X use the homebrew package manager and that changes the permissions of |
Yeah. Ok, sounds good. Thanks a lot for all your help @evanlucas! I'll comment if I run into any other issues. |
How can I uninstall this please? |
Hey @robertandrews: go to /usr/local/lib and delete any node and node_modules 👍 go here for more: http://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x of-course don't worry about the reinstallation bit 💯 |
Thanks, @kelthenoble. /usr/local/lib contains two folders:
/usr/local/bin contains three files:
But grunt and npm seem to be aliases/symlinks. |
maybe at some point you ran
but moving on delete those, if you don't wish to keep them. |
For those in the future finding this through Google... I've revisited the StackOverflow question mentioned by @lordKnighton a few times, but one answer pointed me to a very good direction: https://github.com/brock/node-reinstall I have used that script myself several times and helped colleagues reset their |
Thanks for sharing @dreamyguy :) |
I ran into the same problem last night. When I tried to install it again, there are too many different answers. My co-worker told me that |
Let us know if your good, on your installation @yifanchen, closing for now. |
@lordKnighton good to know, thanks. |
Best way to uninstall node on mac is to run the following command on your terminal: |
use NVM, does not require root privileges or use homebrew...but NVM is probably best. |
moved from nodejs/node#3969 (comment)
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:
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
The text was updated successfully, but these errors were encountered: