Error: EACCES, permission denied Ionic Cordova IOS

后端 未结 11 1170
梦毁少年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:38

    This was what worked for me:

    sudo chown -R $USER:$(id -gn $USER) /Users/YOURUSERNAME/.config

    0 讨论(0)
  • 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'
    
    0 讨论(0)
  • 2020-12-25 13:40

    For me worked:

    sudo chown -R LOGIN ~/.config/configstore/update-notifier-cordova.json

    Also I am using nvm which separates spaces and makes easier to maintain an app.

    0 讨论(0)
  • 2020-12-25 13:43

    After trying every single solution here I had to BEGRUDGINGLY reinstall ionic

    npm i -g ionic

    Begrudgingly because my plan was to upgrade ionic to see what would break but first I wanted to run it at the current version first to see if everything still worked.

    0 讨论(0)
  • 2020-12-25 13:49

    The only thing that worked for me was to uninstall cordova and ionic, then go into the user folder and deleting the hidden files .cordova and .ionic files using sudo permissions. Then reinstall cordova and ionic.

    0 讨论(0)
  • 2020-12-25 13:51

    Similar to jasmo2, this worked for me:

    sudo chown -R LOGIN ~/.config/configstore
    
    0 讨论(0)
提交回复
热议问题