ionic update-notifier-cordova.json' You don't have access to this file
Solution 1
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.
Solution 2
delete the file update-notifier-cordova.json from this location problem solved, it's nothing but just a config file
Solution 3
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
Solution 4
In my project, this problem has been fixed with this lines:
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
Solution 5
changed permission to this folder
sudo chown -R yourusername /Users/yourusername/.config/configstore/
joe
Updated on June 06, 2022Comments
-
joe almost 2 years
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)
-
rinkesh over 8 years@danm07 first you should install npm
-
dmr07 over 8 yearsHad a corrupted npm while I was reconfiguring. This did work, I upvoted.
-
m1crdy almost 8 yearsThe file gets recreated with the same bad permissions. So the top answer fixed that for me