Problems with Getting Started with Ionic

Hi everyone! I have a problem when it comes starting with ionic in osx. I’ll explain the steps I have taken and errors I found, to see if anyone can help me.

  1. I installed node.js from this site: nodejs.org

  2. Thereupon I executed these commands:
    2.1. $ sudo npm install -g cordova ionic cordova
    2.2. $ ionic start myApp tabs
    2.3. $ ionic serve

And with this last order I can see the application running. but if I try to do this:

$ sudo ionic platform add ios

I get this error:

But, These are the versions of the programs I use:

cordova - 3.6.3-0.2.13
Ionic - 1.2.7
Xcode - 6.0.1 (6A317)
XAMPP - 1.8.3-3

Someone could help me solve my problem?

Thank you in advance.

First off, you shouldn’t need to use sudo when adding a platform.

Do you have the xcode command line tools installed at all?

That was one of my problems. I had not installed (xcode-select --install). Now everything works fine (without using sudo), but when I run this command:

$ ionic add platform android

I get this:

Any idea to solve this error?

Thank you in advance.

This just means the android sdk isn’t downloaded and added to your path.

http://cordova.apache.org/docs/en/3.6.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide

http://ionicframework.com/docs/ionic-cli-faq/#android-sdk

1 Like

ok, thank you, I’m going to tried right now!

Other question, is this response normal?

$ sudo npm install -g cordova ionic
npm WARN package.json github-url-from-git@1.1.1 No repository field.

Nope, that something that we should fix out our end. Nothing to worry about for you.

Other problem, right now I want create a new project, and then I get this error:

Is this normal? Could you help me solve it?

1 Like

Nope, this is not normal.

Hmm, do you have git set up on your computer?

1 Like

no, I have sourcetree but I don´t know if this is that I need

Which is the command to install git and configure? Could you help me please?

You can install git from their site.

http://git-scm.com/

1 Like

Thanks, Other Question, When I installing in the first time this:

$sudo npm install cordova ionic ios-sim -g

I need used sudo?

usually use sudo when you are using npm to install things globally(-g option).

Then I can use this: $sudo npm install cordova ionic ios-sim or this $npm install cordova ionic ios-sim -g, It is the same, right?

If you don’t use the -g, cordova, ionic and ios-sim, will be installed locally (on the current directory), then you should manually include them in your $PATH dir, if you don’t these tools won’t work properly.

IMHO use -g to install these tools to avoid some unnecessary headache.

ok @felipew, thank you very much! :slight_smile:

@felipew, one question, do you know why I have this error?:

developer1-Mac-mini:~ developer$ ionic --version
1.2.8
Unable to save ionic data: /Users/developer/.ionic/ionic.config { [Error: EACCES, permission denied '/Users/developer/.ionic/ionic.config']
  errno: 3,
  code: 'EACCES',
  path: '/Users/developer/.ionic/ionic.config',
  syscall: 'open' }

EACCES error usually are related to permissions in the related directory, can you check the permissions in this directory and see if developer haver read/write access ?

perfect, thank you!! I have solved this problem too :slight_smile:

1 Like

@felipew I have a little question, Do you know if the content of this file: “~/.bash_profile” it is correct?

export PATH=${PATH}:/Applications/Android\ Studio.app/sdk/platform-tools:/Applications/Android\ Studio.app/sdk/tools
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=${JAVA_HOME}/bin:$PATH
export PATH=/usr/local/bin:$PATH
export JAVA_HOME=“/usr/libexec/java_home -v ‘1.8*’”
export ANDROID_HOME=/usr/local/opt/android-sdk