Error: EACCES, permission denied Ionic Cordova IOS
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'
None of the solution worked for me
Finally,this work perfectly
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config