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)
In my project, this problem has been fixed with this lines:
delete the file update-notifier-cordova.json from this location problem solved, it's nothing but just a config file
I just changed permission of the file
update-notifier-cordova.json
by below command:And this fixed the problem.
changed permission to this folder
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.
Step 2: Install with the following command
Make sure it installs the recent version, by typing
$ ionic info
you can see the Cordova CLI versionsStep 3: Secure the permissions for the following folders