如何解决此错误:生成EACCES

时间:2015-07-31 07:01:10

标签: android linux cordova ionic-framework ionic

我正在尝试运行此命令 ionic build android 但它给了我这个错误,任何人都可以告诉我我做错了什么。我在app文件夹 sudo chmod -R a + rwx / appfolder 上运行了以下权限命令,但是htis确实没有帮助

******************************************************
 Upgrade warning - for the CLI to run correctly,      
 it is highly suggested to upgrade the following:     

 Please update your Node runtime to version  >=0.12.x

******************************************************
Running command: /home/kwanso/lastProject5/MyFirstApp/hooks/after_prepare/010_add_platform_class.js /home/kwanso/lastProject5/MyFirstApp
add to body class: platform-android
Running command: /home/kwanso/lastProject5/MyFirstApp/platforms/android/cordova/build 
ANDROID_HOME=/home/kwanso/Desktop/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
Running: /home/kwanso/lastProject5/MyFirstApp/platforms/android/gradlew cdvBuildDebug -b /home/kwanso/lastProject5/MyFirstApp/platforms/android/build.gradle -Dorg.gradle.daemon=true

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn EACCES
    at errnoException (child_process.js:1011:11)
    at Process.ChildProcess._handle.onexit (child_process.js:802:34)
ERROR building one of the platforms: Error: /home/kwanso/lastProject5/MyFirstApp/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: /home/kwanso/lastProject5/MyFirstApp/platforms/android/cordova/build: Command failed with exit code 8
    at ChildProcess.whenDone (/home/kwanso/.npm-packages/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:766:16)
    at Process.ChildProcess._handle.onexit (child_process.js:833:5)

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

我解决了一个"产生的EACCES"在我的文件的第一行添加shebang。像:

#!/usr/bin/env node

愿这对某人有所帮助。