EACCES产生错误离子2



我正在写作,因为自一周以来我就面临问题,而且我很难修复它。我希望能得到一些帮助。谢谢建议。

这就是情况。我正在Mac上使用Ionic 2框架开发一个应用程序。当我尝试在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

在两个目录上都没有发生任何事情。

这是我使用离子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的帮助。

相关内容

  • 没有找到相关文章

最新更新