node.js cordova build 命令失败,退出代码为 EACCES
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24409541/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
cordova build Command failed with exit code EACCES
提问by twid
Cordova build failed with error code : EACCESS
Cordova 构建失败,错误代码为: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 proj1tried to re-installing cordovabut did not work
已添加 android 平台proj1尝试重新安装,cordova但没有奏效
回答by malcubierre
For some reason build is not currently an executable file. To fix that, open the terminal and enter the following commands:
出于某种原因,构建当前不是可执行文件。要解决此问题,请打开终端并输入以下命令:
$ cd <your-project-directory>/platforms/android/cordova
$ chmod a+x build
回答by fulvio
This is a common PhoneGap problem.
这是一个常见的 PhoneGap 问题。
Most of the time it has to do with permissions on the buildfolder and script file.
大多数情况下,它与build文件夹和脚本文件的权限有关。
Try using: chmod a+xon them.
尝试使用:chmod a+x在他们身上。
回答by mrmoree
To solve the EACCESS Problem please copy and save your platform custom icons / splashes / config.xml settings and delete the platform folder. after that run phonegap run android from your console again. it should work again. after that copy back the custom files / settings to the new platform folder.
要解决 EACCESS 问题,请复制并保存您的平台自定义图标 / splashes / config.xml 设置并删除平台文件夹。之后再次从您的控制台运行 phonegap 运行 android。它应该再次工作。之后,将自定义文件/设置复制回新的平台文件夹。
回答by tfmontague
My advice is to remove the platformsdirectory, and reinstall each platform.
我的建议是删除platforms目录,并重新安装每个平台。
$ 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.
运行chmod a+x build(如已接受的答案中所建议)并不能解决cordova platform rm <platform>权限问题。将每个平台恢复到其默认状态更安全(也更容易),而不是破解(并记住)单个文件/目录的权限更改。
回答by Johan Hoeksma
My problem was solved by removing the map /platforms/android. After that I added the platform again.
我的问题是通过删除地图 /platforms/android. 之后,我再次添加了平台。
cordova platform add android
科尔多瓦平台添加android
For me it worked out, but I think there are multiple reasons this error is shown..
对我来说它成功了,但我认为有多种原因显示此错误..
! Backup your icons !
!备份你的图标!
Remember to backup your icons in /platforms/android/res/ Or copy the whole map as backup to be sure you don't lose your work...
请记住在 /platforms/android/res/ 中备份您的图标或复制整个地图作为备份以确保您不会丢失您的工作...
回答by jsnelgro
You could brute force it if you are an admin and just sudo chmod -R 777 ./platforms/from the project root directory.
如果您是管理员并且仅sudo chmod -R 777 ./platforms/来自项目根目录,则可以暴力破解它。
回答by vdj4y
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
我有同样的问题,经过无数次试验和错误,今天解决了。我实际上已经获得了 BUILD SUCCESS 出现。
事情是改变环境变量..
从
JAVA_HOME : c:\Program Files(x86)\Java\jre
PATH: c:\Program Files(x86)\Java\jdk1.x.x\bin
JAVA_HOME : c:\Program Files(x86)\Java\jre
路径:c:\Program Files(x86)\Java\jdk1.xx\bin
to
到
JAVA_HOME : c:\Program Files(x86)\Java\jdk1.x.x\jre
PATH: c:\Program Files(x86)\Java\jdk1.x.x\bin
JAVA_HOME : c:\Program Files(x86)\Java\jdk1.xx\jre
路径:c:\Program Files(x86)\Java\jdk1.xx\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.
注意:JAVA_HOME 必须指向JDK/JRE(jdk 的 jre 子代)。我安装了 jre 和 jdk。似乎我需要同时安装这两者,cordova-CLI 才能在 windows8.1 上运行。
我希望这有帮助。
回答by Victor Sosa
Hard to diagnose the problem here. Could you add more information to the problem description?
很难在这里诊断问题。您能否在问题描述中添加更多信息?
For what I can see, which is not too much, it is because one of the executables doesn't have the right exec permissions for your user (assuming you are on Ubuntu 14.04 per your output).
对于我所看到的,这并不算多,这是因为其中一个可执行文件没有对您的用户正确的 exec 权限(假设您的每个输出都在 Ubuntu 14.04 上)。
Ensure Android SDK Tools and Platform-Tools, as well as Oracle JDK and Ant, are in your PATH with the appropriate permissions. Otherwise, put more information here.
确保 Android SDK Tools 和 Platform-Tools 以及 Oracle JDK 和 Ant 位于具有适当权限的 PATH 中。否则,请在此处输入更多信息。

