5
votes

I was trying to create a new Ionic project and when I ran the command:

ionic platform add ios

I got the following error at the end:

Running command: /Users/nnation/myApp/hooks/after_prepare/010_add_platform_class.js /Users/nnation/myApp Error: spawn EACCES at exports._errnoException (util.js:746:11) at ChildProcess.spawn (child_process.js:1162:11) at Object.exports.spawn (child_process.js:995:9) at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:100:31) at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:188:23) at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:131:16) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:114:20 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)

I am not sure what that ment, so i ran it again and I got the following:

$ sudo ionic platform add ios running cordova platform add ios Platform ios already added.

Thinking that everything is good i then ran:

$ sudo ionic build ios

And then this happen again:

running cordova build ios Running command: /Users/nnation/myApp/hooks/after_prepare/010_add_platform_class.js /Users/nnation/myApp Error: spawn EACCES at exports._errnoException (util.js:746:11) at ChildProcess.spawn (child_process.js:1162:11) at Object.exports.spawn (child_process.js:995:9) at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:100:31) at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:188:23) at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:131:16) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:114:20 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)

Can someone assist me in figuring what is wrong or what i am missing? I am running MacOS.

1
sudo ionic ... don't! Make sure the permissions are correct and run the commands without sudo: sudo chown -R nnation:staff /Users/nnation/myAppnaeramarth7

1 Answers

8
votes

I solved this problem using ionic hooks add.

Found it here