I keep getting the following errors:
Error: EACCES, permission denied '/Users/Anuraag/.cordova/lib/tmp' .
Whenever I try to do cordova add platform ios for my cordova app. What is the issue please help!!
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With