EACCES Spawn Error Ionic 2
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了EACCES Spawn Error Ionic 2相关的知识,希望对你有一定的参考价值。
我正在写作,因为我在一周内面临一个问题而且我在修复它时遇到了麻烦。我希望得到一些帮助。谢谢你的建议。
情况就是这样。我正在Mac上使用Ionic 2 Framework开发一个应用程序。当我尝试在android / ios上运行应用程序或尝试简单地构建它时,我总是会收到此错误:
ANDROID_HOME=/Users/manu/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
Error: 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.0
gyp 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/fsevents
gyp ERR! node -v v9.2.0
gyp ERR! node-gyp -v v3.6.2
gyp 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.0
node-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/fsevents
node-pre-gyp ERR! node -v v9.2.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-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.0
added 124 packages, removed 1 package and updated 11 packages in 20.936s
iMac-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的主要内容,如果未能解决你的问题,请参考以下文章
youtube-dl nodejs 有问题 Error: spawn EACCES
Ionic 2 - 错误:EACCES:在 Ubuntu 12.04LTS 上安装时权限被拒绝