This is Bevry's supported guide for installing Node.js on your computer as well as any other required dependencies for your particular system. This guide is Bevry's supported guide, as we've found other guides will leave you with an incorrectly configured environment causing permission errors and missing executables that are hard to track down.
On Linux (Mac OSX, Ubuntu, Fedora, etc)
Mac OSX Preperation
Install Command Line Tools:
Xcode may or may not be necessary for the above command, if it fails, Download & Install Xcode, and try again.
If you use homebrew, you can run
brew install gitinstead of manually installing and downloading git.
Ensure correct permissions are set for
sudo chown -R $USER /usr/local
APT Linux Preperation (Ubuntu)
sudo apt-get update && sudo apt-get install curl build-essential openssl libssl-dev git python
YUM Linux Preperation (Fedora)
sudo yum -y install tcsh scons gcc-c++ glibc-devel openssl-devel git python
Install Node.js via Node Version Manager
Node Version Manager (NVM) lets you install multiple versions of Node.js to your local user directory, enabling easy upgrades and version switching, without the permission troubles that are common with non-NVM setups.
Uninstall any previous Node.js versions you may already have
Install NVM by running the following in Terminal:
git clone git://github.com/creationix/nvm.git ~/.nvm printf "\n\n# NVM\nif [ -s ~/.nvm/nvm.sh ]; then\n\tNVM_DIR=~/.nvm\n\tsource ~/.nvm/nvm.sh\nfi" >> ~/.bashrc NVM_DIR=~/.nvm source ~/.nvm/nvm.sh
Install Node.js by running the following in Terminal:
nvm install node nvm alias default node nvm use node