Download and install the following applications:
- GitHub Desktop (GIT interface)
- https://desktop.github.com/
- Sign in with GitHub account
- Atom (code editor)
- Gitter (chat client)
Install the command line tools from console with the following command:
xcode-select --install
Follow the instructions and install the software.
Homebrew is a package manager for Mac. It can be used to install software packages and all their dependencies easily. Install Homebrew from console with the following command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Check if everything is configured properly with:
brew doctor
If you get a message about chowning directories, run the following (on each of those directories):
sudo chown <username> <directory>
If you get a message about the PATH, add /usr/local/bin
to your $PATH
, either manually or by running the following command:
echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile
Afterwards, open a new terminal window to make sure the new path has taken effect. Then check again if everything is configured properly using brew doctor
.
Lastly, run an update:
brew update
Install Node.js and npm package manager using an installer from the website:
Now create a folder for global packages:
mkdir "${HOME}/.npm-packages"
Configure npm
by creating a ~/.npmrc
file with the following contents:
init.author.name=<name>
init.author.email=<email>
init.author.url=<url>
prefix=${HOME}/.npm-packages
Add this folder to your $PATH
variable in ~/.bash_profile
:
NPM_PACKAGES="${HOME}/.npm-packages"
export PATH="$NPM_PACKAGES/bin:/usr/local/bin:$PATH"
export NODE_ENV=development
Alternatively, if you are using a shared bash configuration file on Dropbox, add the above to that configuration file and make sure your local ~/.bash_profile
contains the following:
if [ -f ~/Dropbox/Work/bashrc.sh ]; then
source ~/Dropbox/Work/bashrc.sh
fi
Update the system variables now:
source ~/.bash_profile
Next install the node version manager tool n using npm:
npm install -g n
Using this tool, you should now be able to install the latest version of node:
n latest
If you still run into permission problems, try troubleshooting with https://docs.npmjs.com/getting-started/fixing-npm-permissions
Install MongoDB using brew:
brew install mongodb
Create a directory for MongoDB's data:
mkdir -p ~/.mongodb-data
Run using the shell command:
mongod --dbpath ~/.mongodb-data
To start automatically when computer starts, create a launch deamon configuration file:
atom /Library/LaunchDaemons/org.mongo.mongod.plist
Past the following in it:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.mongo.mongod</string>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/mongod</string>
<string>--dbpath</string>
<string>/Users/<name>/.mongodb-data</string>
</array>
<key>HardResourceLimits</key>
<dict>
<key>NumberOfFiles</key>
<integer>2048</integer>
</dict>
<key>SoftResourceLimits</key>
<dict>
<key>NumberOfFiles</key>
<integer>2048</integer>
</dict>
</dict>
</plist>
Next, run the following in your terminal:
sudo chown root:wheel /Library/LaunchDaemons/org.mongo.mongod.plist
sudo launchctl load /Library/LaunchDaemons/org.mongo.mongod.plist
sudo launchctl start org.mongo.mongod
You can create aliases for projects using:
alias project="cd ~/Sites/some/long/path/to/project/"
Add these as needed to your ~/.bash_profile
.