Problems with Getting Started with Ionic


#1

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.


#2

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

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


#3

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.


#4

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


#5

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.

#6

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


#7

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?


#8

Nope, this is not normal.

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


#9

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


#10

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


#11

You can install git from their site.

http://git-scm.com/


#12

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

$sudo npm install cordova ionic ios-sim -g

I need used sudo?


#13

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


#14

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?


#15

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.


#16

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


#17

@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' }

#18

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 ?


#19

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


#20

@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