Error: EACCES, permission denied Ionic Cordova IOS

后端 未结 11 1306
梦毁少年i
梦毁少年i 2020-12-25 13:03

I keep getting the following errors:

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

Whenever I try to do cordova

11条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-25 13:40

    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.

    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
    

    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'
    

提交回复
热议问题