Permission denied @ apply2files - /usr/local/lib/node_modules/expo-cli/node_modules/extglob/lib/.DS_Store?
MacosMacos Problem Overview
I was installing the starship via homebrew but I am getting this error:
Permission denied @ apply2files - /usr/local/lib/node_modules/expo-cli/node_modules/extglob/lib/.DS_Store
Any solution for fixing this error?
Thanks.
Macos Solutions
Solution 1 - Macos
This issue appeared after upgrading macOS to Mojave 10.14.X onwards.
Therefore, you need to reset the permissions in /usr/local:
sudo chown -R $(whoami):admin /usr/local/* \
&& sudo chmod -R g+rwx /usr/local/*
Source: https://github.com/Homebrew/homebrew-core/issues/45009#issuecomment-543795948
Solution 2 - Macos
You can change owner by :
sudo chown -R ${LOGNAME}:staff /usr/local/lib/node_modules
Solution 3 - Macos
If you are getting the above error during brew cleanup “Permission denied @ apply2files”, one of the solution which worked in my case was to reset permissions to /user/local. You will have to rewrite permission to the current user. In your terminal copy and paste :
sudo chown -R $(whoami):admin /usr/local/* \
&& sudo chmod -R g+rwx /usr/local/*
Then rerun the command. The permission error should go.
Hope it may help someone in future. Good luck
Solution 4 - Macos
Change permission of the node_modules directory by running
sudo chown -R ${LOGNAME}:staff /usr/local/lib/node_modules
Solution 5 - Macos
You can run the command:
sudo chmod 755 /usr/local/lib/node_modules/expo-cli/node_modules/extglob/lib/.DS_Store
Solution 6 - Macos
first
sudo chown -R $(whoami):admin /usr/local/* \
&& sudo chmod -R g+rwx /usr/local/*
the reinstall all the packages with
brew list --formula | xargs brew reinstall
this part may take few minutes but worked great for me
Solution 7 - Macos
This work for me.
Remove and reinstall brew
.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Solution 8 - Macos
In my case, It works with
sudo chown -R douglas.mesquita:admin /usr/local/lib/node_modules
Solution 9 - Macos
what worked for me, simply delete the directory with
sudo rm -rf %error file path%