Theoretically installing the Ionic framework should be a very simple task. However, I found myself this week wrangling with a new installation after my old one borked.
I’m a fan of the unofficial Mac OS X package manager homebrew, so to complicate matters I stubbornly decided to get this all up and running using it.
The following steps are going to be as much of a reminder for me as they are instructions for you:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
If you’ve already got homebrew installed, you’ll want to make sure it’s up to date by running
brew update(run this twice), then
If, like me, you’re on good old Mac OS X – El Capitan, you may need to follow these instructions to get homebrew working.
OK. Enough yakshaving. Next, use homebrew to install node and npm, making sure not to use
I know. Its tempting when things go wrong to try with
sudo, but I implore you to ignore its siren song lest you get strange permissioning issues down the road.
You’re now ready to install ionic through
npm. You’ll want to run this command with the
-gglobal option to install it system-wide. Technically, you only need to install cordova with ionic, but in this case I’m also installing bower and gulp.
npm install -g cordova ionic bower gulp
Create a new ionic project, or check out an existing one you wish to contribute to
Navigate into your project’s working directory
…And install your local node-managed dependencies:
As a side note – If you are using an existing project, you may have get errors trying to installing all your dependencies again. This is caused by the project originally being built with an older node package manager that had written older versions of your dependencies to your project’s
project.jsonfile. These versions may no longer be available with your new version of node. Fixing is easy enough – just make note of which things failed to install and update your “project.json” file to use the latest stable versions. Then run
npm installagain. In my case, I needed to update PouchDB to “5.1.0” and gulp-sass to “2.1.0”.
Finally! Install any other dependencies managed by other dependency managers (like bower).