错误:EACCES,权限被拒绝Ionic Cordova IOS [英] Error: EACCES, permission denied Ionic Cordova IOS

查看:80
本文介绍了错误:EACCES,权限被拒绝Ionic Cordova IOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不断收到以下错误:

Error: EACCES, permission denied '/Users/Anuraag/.cordova/lib/tmp' . 

每当我尝试做cordova时,就为我的cordova应用程序添加平台ios.有什么问题请帮忙!

Whenever I try to do cordova add platform ios for my cordova app. What is the issue please help!!

推荐答案

您收到的错误来自NPM(因为Cordova CLI是通过NPM安装的).这是一个棘手的问题,其中将NPM与sudo一起使用,然后sudo一起使用将导致奇怪的权限问题.

The error you have received is from NPM (since the Cordova CLI is installed via NPM). This is a tricky issue where using NPM with sudo, and then not using sudo will result in weird permission issues.

如果按照Cordova文档上的说明进行操作,则可以使用sudo安装 Cordova .然后,您可以执行以下操作:

If you followed the instructions on the Cordova documentation, it has you install Cordova using sudo. It then has you do this:

# To ensure permissions are correct, run this command on Mac or Linux, changing LOGIN to match your account name:
$ sudo chown -R LOGIN /usr/local/lib/node_modules/cordova

您这样做了吗?如果没有尝试.如果这不起作用,请确保可以访问'/Users/Anuraag/.cordova/lib/tmp'目录.鉴于它是本地临时目录,因此通过以下类似的方式为它提供完全的读/写访问权限最可能没有什么害处:

Did you do that step? If not try it. If that doesn't work, make sure the '/Users/Anuraag/.cordova/lib/tmp' directory can be accessed. Given that it is a local temporary directory, there is most likely no harm in giving it full read/write access with something like:

chmod -R 777 '/Users/Anuraag/.cordova/lib/tmp'

这篇关于错误:EACCES,权限被拒绝Ionic Cordova IOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆