Volatil3
Volatil3

Reputation: 14978

Ionic: Adding platform gives error

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] 

Upvotes: 4

Views: 1560

Answers (4)

zabusa
zabusa

Reputation: 2719

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

Upvotes: 0

Ankur Soni
Ankur Soni

Reputation: 746

please go to myApp folder

then run the command :

ionic platform add android

Upvotes: 1

Ashwin G
Ashwin G

Reputation: 1570

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

Upvotes: 0

Pete Houston
Pete Houston

Reputation: 15079

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.

Upvotes: 2

Related Questions