Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic update-notifier-cordova.json' You don't have access to this file

I am trying to run ionic on iOS, but it throws an error.

What happened?

ionic run ios
    /usr/local/lib/node_modules/cordova/node_modules/update-notifier/node_modules/configstore/index.js:53
                    throw err;
                          ^
    Error: EACCES, permission denied '/Users/jiahongl/.config/configstore/update-notifier-cordova.json'
    You don't have access to this file.

        at Error (native)
        at Object.fs.openSync (fs.js:500:18)
        at Object.fs.readFileSync (fs.js:352:15)
        at Object.create.all.get (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/node_modules/configstore/index.js:34:26)
        at Object.Configstore (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/node_modules/configstore/index.js:27:44)
        at new UpdateNotifier (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/index.js:34:17)
        at module.exports (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/index.js:123:23)
        at checkForUpdates (/usr/local/lib/node_modules/cordova/src/cli.js:64:20)
        at cli (/usr/local/lib/node_modules/cordova/src/cli.js:114:5)
        at Object.<anonymous> (/usr/local/lib/node_modules/cordova/bin/cordova:41:1)

Error Message

like image 724
joe Avatar asked Nov 19 '15 18:11

joe


5 Answers

I just changed permission of the file update-notifier-cordova.json by below command:

sudo chmod -R 777 '/Users/anand.d.gupta/.config/configstore/update-notifier-cordova.json'

And this fixed the problem.

like image 82
Anand Gupta Avatar answered Nov 01 '22 20:11

Anand Gupta


delete the file update-notifier-cordova.json from this location problem solved, it's nothing but just a config file

like image 29
rinkesh Avatar answered Nov 01 '22 19:11

rinkesh


Deleting the file wont be a right option, the following approach worked out for me. The root cause of this issue is because of the Cordova-cli permissions.

Step 1: Uninstallcordova and install it again.

 sudo npm remove -g cordova 

Step 2: Install with the following command

sudo npm install -g --unsafe-perm=true cordova

Make sure it installs the recent version, by typing $ ionic info you can see the Cordova CLI versions

Step 3: Secure the permissions for the following folders

sudo chown -R <username> /Users/<username>/.config/configstore/
sudo chown -R <username> /Users/<username>/.cordova/

ionic build ios  - Should work like charm
like image 12
kishorekumaru Avatar answered Nov 01 '22 19:11

kishorekumaru


In my project, this problem has been fixed with this lines:

sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
like image 8
slorenzo Avatar answered Nov 01 '22 21:11

slorenzo


changed permission to this folder

sudo chown -R yourusername /Users/yourusername/.config/configstore/
like image 6
Felipe Paiva Avatar answered Nov 01 '22 19:11

Felipe Paiva