Which Ionic CLI to use? 1.7.16 or 2.0.0.xxx beta?

Thanks for the info about these changes! Recently I upgraded my CLI from 1.x to 2.x because I want to develop both Ionic 1 and Ionic 2 apps and the Ionic 2 CLI is backwards compatible with Ionic 1.

I ran into a few (minor) issues which however could all be worked around:

  1. I installed ionic 2 beta-32, beta 33 did not work for me at least with my nodejs version (v.4.2.6):
npm -d install -g ionic@2.0.0-beta.32
  1. To prevent “Error EACCESS” when running ‘ionic build android’ or ‘ionic run android’ (see: https://github.com/driftyco/ionic-cli/issues/375), I ran the command:
chmod -R +x hooks
  1. I use gulp in my build quite a lot (for SASS and for minifying etc) but with the Ionic 2 CLI I’ve stopped including the gulp “default” task in my ionic.project, I keep only the “watch” task.

So, in my ionic.project. I replace:

gulpStartupTasks": ["default", "watch"]

with:

gulpStartupTasks": ["watch"]

I then create a shell script to run ‘ionic serve’ for instance like this:

#!/bin/sh
gulp default
ionic serve --address 127.0.0.1 $*
  1. I ran into conflicts between the node/npm dependencies used by the Ionic 2 CLI and by the Karma test runner (see: stackoverflow.com/questions/35597719/log4js-and-winston-loggers-conflicting-when-trying-to-run-karma-from-ionic-cli).

To fix this, I modified my gulp.js file to include/require the karma nodejs module conditionally (only when it’s necessary: when running tests through karma).

So there’s nothing that can be worked around but figuring out some of the issues took quite some effort. Most of it is probably related to my specific project setup however.

And I ended up choosing nodejs v.4.2.6, other versions (both older and newer) caused various issues.

(and it almost goes without saying, do yourself a favor and use “nvm” to manage your node installations)