In this tutorial, you will learn, how to install the Ionic 2 framework on Mac OS sierra. Installing Ionic 2 framework on Mac OS sierra is similar to windows installation and too easy.

Prerequisite

Mac OS

Software to install
1. Node.js
2. Cordova
3. Ionic

First, you have to install the Node.js. Then you can install the Cordova and Ionic using the npm(Node Package Manager from Node.js)

Installing Node.js

Download Node.js using the below link

https://nodejs.org/en/

It's a pkg extension file. Double-click the downloaded file and follow the steps to install the Node.js.

After installing Node.js, you can check the Node.js installation using

npm -v


Execute the above command in the terminal. It will display the node package manager version if you installed the Node.js software correctly.

Install Cordova and Ionic

To install Cordova and Ionic, go to the terminal and type the below command

npm install -g cordova

npm install -g ionic

Execute the above two commands one by one. However, you can install both using the below command

npm install -g cordova ionic

You can check the installed the Cordova version using

cordova -v

Get the information about the Ionic using 

ionic info

If everything is successful, then you are ready to create the Ionic 2 framework project.

To create a project in the Ionic 2 framework use the below command

ionic start proj_name blank --v2

1. proj_name - user defined project name
2. blank - It will create a new blank application.

Note: Don't forget to include the --v2 while creating the project. Why because,  if you are not including the --v2, then it will create Ionic version 1 project instead of Ionic version 2 project.

To run and preview the application use

cd proj_name
ionic serve --lab

If you are not in the root of the Ionic 2 project, then above command won't work. Please check the directory before running the project.