4

Having first Ionic encounter, I am setting the environment up for an Android app on OSX Yosemite. By running the command sudo ionic platform android I am getting following error:

Error: %s Error: ENOENT, no such file or directory '/Users/myUser/hooks'
    at Error (native)
    at Object.fs.readdirSync (fs.js:761:18)
    at Object.setHooksPermission (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/hooks.js:116:24)
    at Object.IonicTask.run (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:51:13)
    at Object.run (/usr/local/lib/node_modules/ionic/lib/cli.js:95:32)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/bin/ionic:9:10)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
Updated the hooks directory to have execute permissions
Error happened { [Error: ENOENT, open '/Users/myUser/config.xml'] errno: -2, code: 'ENOENT', path: '/Users/myUser/config.xml' }
Error: ENOENT, open '/Users/myUser/config.xml'
    at Error (native)

Versions after running their upgrade:

├── [email protected] 
└── [email protected] 
6
  • Do you have the /Users/myUser/config.xml file? Commented Jan 7, 2016 at 15:15
  • @GuillermoMerino No. How do I generate it. I just installed Ionic. Haven't created project yet. Commented Jan 7, 2016 at 15:45
  • Try adding add as follows: ionic platform add android Commented Jan 7, 2016 at 15:54
  • @Volatil3 When you generate a new project (ionic start YourAppName blank), the config.xml file creates automatically. Commented Jan 7, 2016 at 15:55
  • @Volatil3, why sudo? Commented Jan 7, 2016 at 16:46

4 Answers 4

2

It should be this,

$ ionic platform add android

Also, you'd better not run command with sudo or you might face with troubles with permission some time later.

Sign up to request clarification or add additional context in comments.

2 Comments

for OSX it is needed
The poster has probably made a typo, but this is not a solution, even i am getting this error for ionic platform remove ios
1

please go to myApp folder

then run the command :

ionic platform add android

1 Comment

exactly you need to execute the command into the application folder
0

My android platform was corrupt, after removing it and adding it properly, the issue got solved

Comments

0

go to ionic app folder where your config.xml file exists.and then execute this command.

$ cd Myapp where folder structure should look like this

$Myapp -> ls

$Myapp -> bower.json gulpfile.js ionic.project platforms README.md scss config.xml hooks package.json plugins resources www

$Myapp -> ionic platform add android

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.