cordova build Command failed with exit code EACCES

2019-01-23 02:16发布

Cordova build failed with error code : EACCESS

$ cordova build android
Running command: /home/user/proj1/platforms/android/cordova/build 
execvp(): Permission denied
Error: /home/user/proj1/platforms/android/cordova/build: Command failed with exit code EACCES
    at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.EventEmitter.emit (events.js:95:17)
    at Process.ChildProcess._handle.onexit (child_process.js:795:12)

 ======================================   
     OS  : Ubuntu 14.04
     npm version: 1.4.16
     cordova version : 3.5.0-0.2.4
 ======================================

have added android platform to proj1 tried to re-installing cordova but did not work

8条回答
劫难
2楼-- · 2019-01-23 02:59

My advice is to remove the platforms directory, and reinstall each platform.

$ cd <your-project-directory>
$ rm -r platforms  # -or- manually remove the directory
$ cordova platform add <platform>  # ios, android, ...

Running chmod a+x build (as suggested in the accepted answer) doesn't fix cordova platform rm <platform> permission issues. Safer (and easier) to restore each platform to it's default state, instead of hacking (and remembering) permission changes for individual files / directories.

查看更多
别忘想泡老子
3楼-- · 2019-01-23 03:00

I have same problems, solved it today after countless of trials and error. I have actually get BUILD SUCCESS to appear.
the thing is to change the environemnt variable..
from

JAVA_HOME : c:\Program Files(x86)\Java\jre
PATH: c:\Program Files(x86)\Java\jdk1.x.x\bin

to

JAVA_HOME : c:\Program Files(x86)\Java\jdk1.x.x\jre
PATH: c:\Program Files(x86)\Java\jdk1.x.x\bin

NOTE: the JAVA_HOME has to point to JDK/JRE (the jre child of jdk). I install both jre and jdk. it seems that I need to install both for the cordova-CLI to work on windows8.1.
I hope this helps.

查看更多
登录 后发表回答