Winter is upon us, and I finally found some time to start my new article series covering next Ionic iteration also known as Ionic 2.0.
Unlike a previous v1 version, this one requires Angular2 so make sure you have at least a basic understanding. This series will be written from the perspective of Android and Windows OS, don’t worry; you can reuse this code on Linux or MacOS.
One last thing before we start, I will write roughly 20+ articles so stay tuned.

Note: If this tutorial was helpful, need further clarification, something is not working or do you have a request for another Ionic post? Furthermore, if you don't like something about this blog, if something is bugging you, don't like how I'm doing stuff here, again leave me a comment below. I'm here to help you, I expect the same from you. Feel free to comment below, subscribe to my blog, mail me to, or follow and mention me on twitter (@gajotres). Thanks and have a nice day!

PS. If you want my help, if possible (even if it takes you some time to do that), create a working example I can play with. Use Plunker for AngularJS based questions or jsFiddle for jQuery/jQuery Mobile based questions.


Table of Contents

The Ionic 2 is a complex and sometimes difficult field of study so this article will hardly satisfy all your needs. If you require more information beyond the subject of this article you will probably find it in a list below. Take a look; if there’s a topic not covered there, leave me a comment and I’ll cover it.


Before we can start playing with Ionic, make sure you have everything set up for Android development (Apache Ant, Java SDK, and Android Studio), I will not cover that topic here.
We will install these:
  1. Install nodeJS
  2. Install Ionic && Cordova

1. Install nodeJS

First thing first, before we can install Ionic and Cordova we need to have Node.js.
Just make sure to select an appropriate version depending on your Windows platform (32 bit or 64 bit). During the installation, remember final location. In this case, it’s:
c:\Program Files\nodejs\
Download Link
It should look like this:
Ionic Tutorial 1001
Please don’t disable an “Add to PATH” check, it will add nodeJS PATH location automatically.
If you have a previous nodeJS installation, please upgrade it to a newer one. If you receive this error:
    throw err;
Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'

at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
edit your Windows environment PATH and remove old nodeJS bin folder location:
C:\Program Files\nodejs\node_modules\npm\bin
Technically this error may occur only if you update an older nodeJS installation.

2. Install Ionic && Cordova

For this tutorial to work we only need Ionic but we’ll also add Cordova, just to make sure everything is working as intended.
Before we install Ionic/Cordova we need to change the location where nodeJS will install our software. You can skip this step, but I advise you to do it just like me, it will make your life easier in a long run.
Default installation folder is strangely placed in this hidden location: C:\Users\{username}\AppData\Roaming\npm. We can change this destination folder manually, just go here: C:\Users\{username}\ and create an empty file called: .npmrc (make sure you have administration privileges).
Finally, add this line (don’t forget to save):
prefix = "C:\\{your location}"
{your location} is a desination folder where nodeJS should install all required software (Ionic and Cordova). Also don’t forget to use double \\, it will not work in any other case. For this article we will use prefix = “D:\\JavaScript\\nodejs”
When everything is set and ready install Ionic and Cordova. Open command prompt CLI (with administrator privileges) and type/execute this:
npm install -g cordova ionic@beta
Warning: Ionic2 is still in alpha status so the final implementation may differ from this code. I will update this article if and when that happens.
Now sit back and relax, give it some time to finish, it can take several minutes depending on your internet connection. If you’re behind a corporation firewall this step may fail. In this case, try several times before contacting a network administrator.
You can close a CLI window now. The last thing we need to do is add D:\JavaScript\nodejs directory to Windows environment PATH. This way we will be able to work with Cordova and Ionic directly from a command line. Take a look at this tutorial if you don’t know how.
I’m going to use this location:
or in your case:
C:\{your location}\nodejs
Copy that location and add it to your environment PATH like, like this:
Ionic Tutorial 1010
Open a new command line window and execute this:
cordova -v
ionic -v
Both of these commands will output appropriate software version.


Just to be on a safe side, we’ll test this installation. This part will not work without configured Android development environment.
Now is a good time to connect your Android smartphone to your computer, unless you’re willing to do this with preconfigured emulator.
Use previously opened command line window and go to some temp folder; when we finish here you’ll want to delete newly created project folder.
ionic start tempProject tutorial --v2
cd tempProject
ionic serve -l -c -s

What to read next

Ionic 2 | A Page Anatomy Part 1 – The Root Component

Who Am I?

Between working as a senior Java developer in one of the largest insurance companies in the world and traveling, in my free time, I work as a professional mobile development adviser. I'm also a major jQuery Mobile supporter back at StackOverflow and a forum moderator at the official Ionic Framework forum.

  • bel3atar

    How was bower replaced in v2? How to install third-party client-side js libraries now?

  • Leonel Corso

    Can I have ionic1 and ionic2 in the same computer?

    • It depends. You can have ionic1 and ionic2 environments at the same time, but one project can’t use both frameworks at the same time.