How to Clone and Setup the freeCodeCamp Website on a Mac

How to Clone and Setup the freeCodeCamp Website on a Mac
0

#1

This guide works with the freeCodeCamp repository and has been tested on macOS Sierra 10.12.2.

Prerequisites

  1. Homebrew
  2. Node.js
  3. Gulp
  4. MongoDB

Instructions

Follow the instructions in [this guide] (https://forum.freecodecamp.com/t/installing-cli-tools-developers-should-not-live-without-linux-and-mac/19411) to download and install prerequisites 1-4. To install and setup MongoDB, do the following:

brew install mongodb
brew services start mongodb

This will automatically start the MongoDB server as a background service when you login to your Mac. The default configuration file (/usr/local/etc/mongod.conf) should work just fine.

To verify that the installation was successful:

  1. Verify that Node is in the path with node -v
  2. Verify that npm is in the path with npm -v
  3. Verify that gulp is in the path with gulp -v
  4. Verify that MongoDB is running with mongo. You should see messages similar to the following:

MongoDB shell version v3.4.1
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.1

Exit the MongoDB client with exit.
5. Follow the freeCodeCamp Contributor’s Guide to fork and clone the project.

Optional

Your Mac comes preinstalled with bash, zsh, git, python, ruby, and many other useful programs. However, they usually become outdated quickly. To take advantage of the latest features and security updates, install the desired packages using Homebrew. For instance, brew install zsh git will install the latest versions of zsh and git in one go.

To make sure the latest versions are invoked when you type the commands, add this line to your .bashrc or .zshrc: export PATH="/usr/local/bin:$PATH". Then reload with either source .bashrc or source .zshrc and check if everything’s in order: echo $PATH. “/usr/local/bin” should be in front of “/usr/bin” and “/bin”.

Last but not the least, you can create a folder called “Developer” in your home folder for all your projects. Finder will put a hammer on the folder icon, like this:


Gulp not installing
#2

#3

#4

I had a problem starting mongod and I would like to share how I solved it.

If /data/db does not exist you will need to add it and give yourself permission to write to it:

sudo mkdir -p /data/db
sudo chmod a+w /data/db

Improving MongoDB setup for MacOS
#5