简体   繁体   中英

How to fix this Error: spawn EACCES

I am trying to run this command ionic build android but it is giving me this error can anyone tell me what am I doing wrong. I have run the following permission command on app folder sudo chmod -R a+rwx /appfolder but htis does'nt help

******************************************************
 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)

Any help will be appreciated.

I solved a "spawn EACCES" by adding a shebang at the first line of my file. like:

#!/usr/bin/env node

May this help someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM