[Solved] Ionic Cordova Does Nothing (Shows No Error) After Build Or Run On Node 5.0

I had an interesting issue with Ionic recently. When I run
ionic platform add ios (or any other platform), I see a good message suggesting it added some hooks successfully…

But when I run ionic build ios or ionic run ios (or emulate), I get no output at all. Nothing happens. No emulator opens in the case of run/emulate.

It also wasn’t specific to ios. Same with android and browser.

I found that Cordova had an issue with NodeJS 5.0 and NPM 3.x, which I have installed recently. Googling online suggested people kept going by reverting to NodeJS 4.x.

What Didn’t Work

The Cordova problem was supposedly solved in Cordova 5.4.0. I installed that (just npm install Cordova as it’s the latest at the moment), but this caused me to get random NodeJS execution errors instead of getting no output.

Well, at least that was feedback. Hooray for progress!


I didn’t want to give up and go back to NodeJS 4.x, so I tried the following, and it worked :)

At this point I tried ionic platform add ios,
ionic build ios, and ionic run ios

And they all just worked as expected :)

Notes For The Careful Observer

  • I already had latest NodeJS before running the commands, as confirmed by brew upgrade NodeJS (Yes, my test was on Mac), which has NPM 3.3.9.
    But I updated NPM (which got me NPM 3.3.12) just as a random step while troubleshooting the problem. It could well be not necessary to get this working.

  • In the commands above I remove Phonegap but don’t install it again. It’s not because I suspect it’s involved. I was just being extremely cautious.
    I didn’t show installing it again because it’s not required for getting Ionic/Cordova to work again, but it’s sure is safe to install again.

xperience went.


There is a problem with XCode tools for Mac OS El Capitan that causes an error to show up when you run the emulator (like ios emulate ios).

The error is safe to ignore as long as the last line of the output was
** RUN SUCCEEDED **, and the emulator actually opens and shows your app.

Apart from that, iOS emulator seems to be miles ahead of Android in terms of speed etc. Says me, the Android-only owner!

Now To You…

Let me know if that helped you, and your own e

Selenium Bindings For NodeJS Made Easy(ier) With TypeScript Async/Await

In previous post I described how I used TypeScript with Babel to get my JavaScript Selenium tests to be executed by Node.

I wanted to dedicate this separate post to an example of the Selenium code that I wrote, because there are many tricks and gotchas that need your full attention.

That’s mainly around the use of async/await of course. Instead of write a paragraph about each piece of the code, I have embedded my points in the code itself.

The sample simply goes to the Angular2 Github repository, and reports the title and date of the first page of open issues in the repository.


In case you wonder, here are the packages used above, in a single NPM install command

This doesn’t involve the build configuration to get this compiled and running.

Check out my other post to learn how to setup the build for this.

Finally, I hope those two articles combined help you write your own asynchronous code with ease, with Selenium or any other purpose.

Using Babel With TypeScript – You DON’T Have To Choose One!

Use Case

The Selenium bindings for NodeJS are very nice that everything is a promise. When you are sending a command to the browser, this command might pass (say, return the element if found), or fail (say, trying to click an element that doesn’t exist), so, it’s a good fit for promises.

However, when I write tests, I think of them as a sequence of steps. With promises, the next step is always in a then() function.

But no one wants to keep nesting code like
x.then((y)=>y.then( (z)=>z.then(...) )).
Selenium extends promises so that you don’t have to do this all the time, but I soon hit limits (like loops).

Then I remembered reading about TypeScript support for async/await. When I tried it, the coding experience was nice, but I had to do a bit of setup.

Configuring Async / Await In TypeScript

I had to turn some experimental flags on, and target ES6. The easiest way to do this is to create a tsconfig.json file in the directory where I run tsc (TypeScript compiler) from. Here’s what mine mainly looked like:

Node, ES6, Babel, And ES7

I tried to run the output of TypeScript in Node, but it didn’t work. It complained about import statements. It seems that Node doesn’t understand ES6 module system, not very surprising given it has its own module system too, commonJS.

TypeScript can target commonJS, but async/await is only supported when targeting ES6.

So, I decided to take the output through Babel before I run it with NodeJS.

Side Note: Babel already had support for async/await as it’s also coming to ES7. But by the time I got to that I was already happy with my autocomplete experience in TypeScript that I wanted to continue with this setup.

Using Atom Editor

It was so easy to get babel to work with TypeScript in Atom. I had atom-typescript package installed, and it suppoted an extra property in tsconfig.json:

This is a NON-standard TypeScript property. But it allowed me to work very happily with Atom, and my .ts files processed via TypeScript and Babel whenever I save them.

This approach had a main no-go issue though. Anyone who pulls my code should be able to get it to work without me committing the “auto-generated” JS files, and without the others having my Atom setup, and building the project from Atom. This won’t work in CI build server.

Using Gulp Tasks

At this point, I decided to have a gulp task that does the transformation. It turned out to be very easy.

The following code sets gulp to process all .ts files in “app” folder via TypeScript and Babel, and save them as .js files:

You might wonder why did I do both transformations in the same task. That’s mainly to save disk writes, so that I don’t have to write an ES6 file that’s never going to be used except for Babel processing.

If you want to split them, should be easy, like:

NPM Prerequisites

To run these, you need to install the needed packages:

Example & Conclusion

So, that’s all it takes to run the compilation/transpilation. You might want to hook this into nodemon or some gulp-watch task etc., but this is not specific to TypeScript or babel in any way, so, I thought it’s not worth mentioning here.

If you are curious about the code that I needed this setup for, check out my sample code post.

Angular2 Browser Support Announced For IE9, Android 4.1, And iOS 7.1

While Angular 2 promised a lot of cool things, it also came with a big disappointment for some developers. It was browser support.

Angular’s future centric approach made it target only evergreen browsers on the desktop. That meant that the only Internet Explorer version it was going to support is IE 11, which meant that developers targeting IE 9 or IE 10 are out of luck.

It also raised the question about mobile browsers. The only builtin evergreen browser rendering engine on mobile is Chrome in some Android 4+ devices. The team didn’t originally provide a mobile strategy.

Luckily for all of us, this has just got changed :)

Today Brad Green from the AngularJS team announced the browser versions Angular 2 is going to support, on both desktop and mobile:.

Can you see it? YES, that’s IE 9 in there!

I couldn’t believe it that I went on to confirm from Brad:

The mobile support is also awesome, as you can see, going all the way back to Android 4.1 and iOS 7!

How To Track

As per the exact announcement:

You’ll be able to track Angular 2 support and progress vs current browsers by looking at the status page of the browser testing build, available at:


The results are shown in a little widget image in the Angular 2 repository homepage, as Brad notes. Which is of course github.com/angular/angular.

Do not panic if you see some red instead of green in there by the way, as Angular 2 is obviously still work in progress.

Using `bindToController` & `controllerAs` Together In The Same Angular 1.4+ Directive

When I looked for articles about how to use bindToController in directives, I saw a lot of code samples that look like:

What Doesn’t Work?

With that, I should be able to use the directive in the following way:
(not using a directive template here, maybe that’s what others tested!)

And that should display success, right? It doesn`t!

Things I tried:

  • Defining the controller separately via angular.controller(...), vs making it a function in the directive definition object (DDO) as above

  • In the scope, changing the property name to be different from the directive name.

What Works? The solution

Simply, swap the values of bindToController and scope!

Like this:

I already read that in Angular 1.4 you can use the bindToController property similar to how you use the scope property, meaning you use it to define what properties are created in the new scope.

I still thought I need scope: {} though to make that new scope magic work. But it turned out that this was actually ruining it. All I needed was to set it to true to have a separate scope.

Complete Sample

I have kept it stupid simple so that the main point is not lost.

See the Pen bindToController Sample by Meligy, Mohamed (@Meligy) on CodePen.