macOS - Permission denied @ apply2files - /usr/local/lib/node_modules/expo-cli/node_modules/extglob/lib/.DS_Store?

Viewed 78158

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.

9 Answers

You can change owner by :

sudo chown -R ${LOGNAME}:staff /usr/local/lib/node_modules

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

Change permission of the node_modules directory by running

sudo chown -R ${LOGNAME}:staff /usr/local/lib/node_modules

You can run the command: sudo chmod 755 /usr/local/lib/node_modules/expo-cli/node_modules/extglob/lib/.DS_Store

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

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)"

In my case, It works with

sudo chown -R douglas.mesquita:admin /usr/local/lib/node_modules

what worked for me, simply delete the directory with

sudo rm -rf %error file path%
Related