EACCES Spawn Error Ionic 2

时间:2017-12-16 13:49:14

标签: android angular mobile ionic2

我写作是因为我在一周内遇到了问题并且我无法修复它。我希望得到一些帮助。谢谢你的建议。

就是这种情况。我在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$ 

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。

我试图在

之前执行以下命令
sudo chmod 755 /Applications/Android\ Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle

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

sudo chmod 777

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