First you need to get your environment set up. You may already have some of the tools described below installed and configured, but make sure that you read carefully to make sure that you don't miss anything.
Here's what you need to install:
XCode (required for all compilation on Macs)
Homebrew (for easy installing)
Node & NPM
Optional: Imagemagick (for fast image manipulation with animated GIF support)
First, you need to install the Xcode Command Line Tools.
Open XCode (Download it from the App Store if you don't currently have it installed.)
Go to Xcode → Preferences → Locations and set the version for the Command Line Tools Option.
Next, you need to install Homebrew, a convenient software manager that makes it easier to manage and update your software packages.
Launch the "Terminal" app.
Copy and Paste this one-line command to the terminal to install Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Now that you have Homebrew installed it only takes one command to install Node:
brew install node
The terminal prompt finds commands in folders listed in an environment variable called PATH. We'll need to add node's directory to our $PATH in order for it to work its magic.
Create a plaintext file called
.profile in your home directory if you don't already have one. You can use the
touch command from the command line to create a new file:
Open it with your favorite text editor, or use the following command to open it with the default editor:
Add these two lines to the file and save it:
\~/.profileexport NODE_PATH="/usr/local/lib/node"export PATH="/usr/local/share/npm/bin:$PATH"
Verify that this worked by opening a new Terminal tab and running:
If it worked, it will echo the current PATH setting as a set of colon-separated values, beginning with your additions.
NPM may or may not have been installed with Node. Try:
If you get a "not found" error, run this:
curl -L https://npmjs.org/install.sh | sh
You'll need git to manage your source code. Macs come with it, but we suggest you get the latest via Homebrew. From the command line:
brew install git
Apostrophe uses MongoDB as its database. You can install it with Homebrew. In addition, you can configure
brew services to launch it automatically for you, so you don't have to fuss with restarting it manually.
First you need to install the "tap" for Mongo DB:
brew tap mongodb/brew
Next install MongoDB:
brew install mongodb-community
After it is installed, start the MongoDB service:
brew services start mongodb-community
Now open a new terminal window and try:
An interactive mongo prompt will start. Press
control+c to exit.
Like most of what you've done so far, installing ImageMagick is just a matter of one command:
brew install imagemagick
This provides the
identify command line tools, which Apostrophe uses to scale and crop images quickly, with animated GIF support. If you skip this step, Apostrophe can still handle image uploads more slowly, thanks to Jimp.
Now your environment is configured you're ready to create your first Apostrophe project.