2015-04-05 203 views
3

Nitishs-MacBook-Air:~ nitishanand$ cd myApp Nitishs-MacBook-Air:myApp nitishanand$ sudo ionic platform add android Downloading Default Ionic Resources離子/科爾多瓦須藤離子平臺添加的Android不工作

Downloading: https://github.com/driftyco/ionic-default-resources/archive/master.zip [=============================] 100% 0.0s Done adding default Ionic resources Adding icons for platform: android running cordova platform add android Adding android project... Creating Cordova project for the Android platform: Path: platforms/android Package: com.ionicframework.myapp639143 Name: myApp Android target: android-21 Copying template files... Project successfully created. Running command:
/Users/nitishanand/myApp/hooks/after_prepare/010_add_platform_class.js
/Users/nitishanand/myApp Error: spawn EACCES
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1155:11) at Object.exports.spawn (child_process.js:988: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)

回答

8

嘗試做

chmod 755 /Users/nitishanand/myApp/hooks/after_prepare/010_add_platform_class.js 

它爲我工作。

+0

使用較新版本的Ionic命令行,它會自動執行此操作,以確保您擁有最新版本:'sudo npm install -g ionic' – TheBosZ 2015-05-24 19:30:37