Ionic: adding a platform gives an error

After the first meeting with Ionic, I install the environment for the Android application on OSX Yosemite. Running the command sudo ionic platform android, I get the 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 starting the update :

├── cordova@5.4.1 
└── ionic@1.7.12 
+4
source share
4 answers

It should be,

$ ionic platform add android

Also, you better not run the command with sudo, or you may run into permission problems after a while.

+2
source

go to myApp folder

then run the command:

ion platform add android

+1
source

Android , .

0

go to the folder with the ionic application, where there is a config.xml file. Then run this command.

$ cd Myapp where the 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

0
source

Source: https://habr.com/ru/post/1623287/


All Articles