EACCES Spawn Error Ionic 2

时间:2023-05-26 11:00:01 买帖  | 投诉/举报

篇首语:本文由小编为大家整理,主要介绍了EACCES Spawn Error Ionic 2相关的知识,希望对你有一定的参考价值。

我正在写作,因为我在一周内面临一个问题而且我在修复它时遇到了麻烦。我希望得到一些帮助。谢谢你的建议。

情况就是这样。我正在Mac上使用Ionic 2 Framework开发一个应用程序。当我尝试在android / ios上运行应用程序或尝试简单地构建它时,我总是会收到此错误:

ANDROID_HOME=/Users/manu/Library/Android/sdkJAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/HomeError: spawn EACCES[ERROR] An error occurred while running cordova run android (exit code 1).

我试图运行这样的命令:

sudo chmod -777 /Users/manu/Library/Android/sdk

要么

sudo chmod -775 /Users/manu/Library/Android/sdk

两个目录但没有发生任何事情。

这是我使用Ionic 2的第一个项目,也许我错过了一些愚蠢的东西......

感谢您宝贵的时间。

编辑

试图更新CLI我得到了这个:

node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-node-v59-darwin-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.3 and node@9.2.0 (node-v59 ABI, unknown) (falling back to source compile with node-gyp) gyp ERR! clean error gyp ERR! stack Error: EACCES: permission denied, rmdir "build"gyp ERR! System Darwin 17.2.0gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js" "clean"gyp ERR! cwd /usr/local/lib/node_modules/ionic/node_modules/fseventsgyp ERR! node -v v9.2.0gyp ERR! node-gyp -v v3.6.2gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute "/usr/local/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js clean" (1)node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:159:13)node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:943:16)node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)node-pre-gyp ERR! System Darwin 17.2.0node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/ionic/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"node-pre-gyp ERR! cwd /usr/local/lib/node_modules/ionic/node_modules/fseventsnode-pre-gyp ERR! node -v v9.2.0node-pre-gyp ERR! node-pre-gyp -v v0.6.39node-pre-gyp ERR! not ok Failed to execute "/usr/local/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js clean" (1)npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/ionic/node_modules/fsevents):npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 install: `node install`npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1+ ionic@3.19.0added 124 packages, removed 1 package and updated 11 packages in 20.936siMac-di-Manuel:/ manu$ 

答案

我找到了解决方案。

我之前尝试过以下命令

sudo chmod 755 /Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle

我犯了一个错误,我改变了Gradle的版本,然后它运作了。我用了

sudo chmod 777

而不是755,但结果是一样的。感谢Sébastien的帮助。

以上是关于EACCES Spawn Error Ionic 2的主要内容,如果未能解决你的问题,请参考以下文章