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:

  1. Install homebrew

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  2. 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

    brew doctor

  3. If, like me, you’re on good old Mac OS X – El Capitan, you may need to follow these instructions to get homebrew working.

  4. OK. Enough yakshaving. Next, use homebrew to install node and npm, making sure not to use sudo.

    brew node

    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.

  5. You’re now ready to install ionic through npm. You’ll want to run this command with the -g global 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

  6. Create a new ionic project, or check out an existing one you wish to contribute to

  7. Navigate into your project’s working directory

    cd ~/Code/My_Project

  8. …And install your local node-managed dependencies:

    npm install

    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.json file. 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 install again. In my case, I needed to update PouchDB to “5.1.0” and gulp-sass to “2.1.0”.

  9. Finally! Install any other dependencies managed by other dependency managers (like bower).

    bower install

Source: https://github.com/sass/node-sass/issues/1166