Finally a solution came up playing with permissions! I hope I havenβt scored anything. (I'm a noob btw terminal.) Anyway, here is the solution.
Run this code here in the terminal (you may need to run cd .. before you start)
sudo chown -R $USER /usr/local/
This changes the permissions of each thing inside the local folder (hence -R , which means recursive). (I found this line somewhere on ion forums).
Now you need to reinstall cordova and ionic
sudo npm install -g cordova sudo npm install -g ionic
For me, anyway, after that I can type ionic and not get any errors. I get this in the terminal if I run cordova , though.
/usr/local/lib/node_modules/cordova/node_modules/update-notifier/node_modules/configstore/index.js:53 throw err; ^ Error: EACCES: permission denied, open '/Users/Dylan/.config/configstore/update-notifier-cordova.json' You don't have access to this file.
What I did to fix this is to do it (after opening a new terminal window):
sudo chown -R $USER Dylan
(Dylan is my user folder, replace it with yours. In addition, you may need to run cd .. before running this line. And this fixes the permissions for this configuration file. Now running cordova works without errors! This error may return, so you need to run this line of code again.
Hope this helps someone!
source share