Installing StrongLoop on OS X 10.11 (El Capitan)
David Dhuyvetter 1200009JF6 Visits (4561)
IBM recently acquired StrongLoop for its Middleware portfolio. StrongLoop is built on the open source LoopBack framework, and Node.js. Node has a vibrant developer community with extremely rich tools, but can be a bit of an adjustment for folks with a trad
Installing StrongLoop on OS X is pretty straightforward, but there are some pre-requisites that need to be installed first. The steps may vary slightly, depending on the version of OS X and XCode you are using.
1. Install XCode
XCode is required for StrongLoop. It is used to build some components during the install process. It is helpful to install it before the other pre-requisites. XCode is installed using the App Store application. XCode is a free download, but you must have an Apple ID to install it.
It is a large app, so it will take a while to download and install. Once the install completes, you need to run it once to accept the license and allow it to finish its setup.
Decide whether you agree to the license terms. If you do, then click on the Agree button. When prompted, provide your password and click on OK. A dialog will then open indicating that XCode is installing some components. When this completes, you can exit XCode.
2. Install Homebrew
There are two popular package managers for OS X: Homebrew and Mac Ports*. Either can be used to install Node.js. I've chosen Homebrew because that's the one I'm most familair with. With XCode installed, setting up Homebrew is easy. Open a terminal window and enter:
The install will proceed in several steps, requiring you to press RETURN to continue, and will require you to enter your password. When it completes you can proceed to installing Node.js. If you are an existing Homebrew user, make sure you run
* Evidently there is another package manager called Fink that can also be used to install Node.js, but it looks like it has an older version (10.26).
3. Install Node.js
To install the latest stable version of Node.js, open a terminal window and enter:
This, as of today, will install Node.js v 5.1.0. If you want to install an earlier version, you need to specify the version to install. To see the available versions, open a terminal window and enter:
This will list various packages with "node" in the name, as well as a number of entries in the form: home
Either the latest or the LTS version should be used. Once node is installed, you can verify the installation by typing:
4. Install and Verify StrongLoop
When you install Node.js, you also get the Node
Strong loop takes a while to install. (~12 minutes on my system. YMMV depending on network speed and processing power available) When the install completes, you can verify it with the
There is a walkthrough showing how to create and run a hello-world LoopBack app from the command line. You can also use StrongLoop Arc to create and run a simple model. In either case, the first step is to use the slc command line tool to create a LoopBack project:
$ slc loopback
| | .---
|--(o)--| | Let's create a LoopBack |
`---------´ | application! |
( _´U`_ ) '---
| ~ |
´ ` |° ´ Y `
? What's the name of your application? hello-world
? Enter name of the directory to contain the project: hello-world
Change directory to your app
$ cd hello-world
Create a model in your app
$ slc loopback:model
Compose your API, run, deploy, profile, and monitor it with Arc
$ slc arc
Run the app
$ node .
StrongLoop uses Yeoman to scaffold the project. The funny little ASCII art guy is Yeoman's signature. Once the project is created, cd into the project directory and type:
StrongLoop Arc will open in Safari. There is an overview of StrongLoop Arc here.
Even though StrongLoop Arc is running on your local machine, the login is via http
Click on Composer to compose an API. In the composer window, click on Add New Model to create a new model.
Give your model an Name, tell Composer the correct Plural of the name, define some Properties, and click on Save Model.
You can start your app right from the Composer by clicking on the run icon in the upper right
Click on the Play button to start the app. The state should change from STOPPED to RUNNING on http
The simple model in StrongLoop Arc is really just a smoke test for the environment, and doesn't really scratch the surface of what can be done with StrongLoop. As a next step, you may want to install a data store to see with LoopBack, such as MongoDB or MySQL. Fortunately, Homebrew can help with those too. I have lots of learning to do myself on the abilities and best practices of/with StrongLoop, but with the software installed. I'm ready to be dangerous. :-)