Error when running ionic platform ios (first ionic program)


#1

I had no errors/issues installing cordova or ionic through npm. But then I ran into this:

sudo ionic platform ios

Running platform task…
Adding platform ios
Creating ios project…
Unable to add platform ios. Please see console for more info.

What console are they referring to? How do I figure out what is going on? I added the command line tools in xcode. I read that i needed to add ios-deploy, and added that too. Same error message. Is there something else I need?


#2

Heya! I’m new to Ionic and I’m getting the same error as well. The actual error after running the tasks is;

Running platform task…
Adding platform ios
Downloading cordova library for ios…
Download complete
Creating ios project…

TypeError: Cannot set property 'is_top_level' of undefined
    at Object.installPlugin (/usr/local/lib/node_modules/cordova/node_modules/plugman/src/install.js:42:26)
    at /usr/local/lib/node_modules/cordova/src/platform.js:318:44
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:821:14
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:415:13)

Unable to add platform ios. Please see console for more info.

Any suggestions would be awesome.

Kristof


#3

i’d suggest you to use Cordova commands for Cordova stuff!
http://cordova.apache.org/docs/en/3.4.0/
they have full docs and tutorials about setting up the project.


#4

anyway also Ionic tutorial now uses just plain Cordova commands:
http://ionicframework.com/docs/guide/installation.html


#5

Awesome! Thanks for that, will give it a bash today and report back.


#6

This seems to be a bug with Cordova. If you roll back to a previous version it should work fine.

I use npm install -g cordova@3.4.0-0.1.0